LNMP One-Click Package Causes WordPress Theme Display and Editing Issues

Publish: 2015-10-31 | Modify: 2017-06-21

After switching the website environment from AHM 4.2 to Junge's LNMP 1.2 one-click package, various problems occurred. However, most of them have been resolved through online documentation. One of the issues is that after using Junge's LNMP environment, only the currently used WordPress theme can be seen in the theme options (other themes cannot be displayed), and the current theme cannot be edited and saved online.

According to online resources, it is found that the scandir function is disabled by default in the LNMP environment. To enable the scandir function, you just need to edit the configuration file /usr/local/php/etc/php.ini and save it.

sed -i 's/,scandir//g' /usr/local/php/etc/php.ini
/etc/init.d/php-fpm restart

Another method is to execute the following command:

sed -i 's/,scandir//g' /usr/local/php/etc/php.ini
/etc/init.d/php-fpm restart

In addition, you may also encounter issues such as unable to send emails via SMTP using Socket connection or Akismet not working in WordPress. This may be due to the disabled pfsockopen and fsockopen functions. To enable them, execute the following commands:

sed -i 's/,fsockopen//g' /usr/local/php/etc/php.ini
sed -i 's/,pfsockopen//g' /usr/local/php/etc/php.ini
/etc/init.d/php-fpm restart

Comments