Focus on cloud service provider activities
Notes on website operation and maintenance

Solve the problem that the WordPress program cannot switch the installation theme in the background

When most users use VPS to set up the website environment, they will either use the WEB panel or one button package. Those who pursue technology or reflect their own capabilities will install their own assembled environment. Among the many one button package environments, the military brother LNMP environment is still used more. In June, version 1.2 was released. Although we saw many problems when we first released the new version, it should be stable after several months.

Lao Zuo found that the permissions of this one click package were too strict when applying WordPress programs. For example, when we started a theme online in the background, we could not see other theme packages in our theme directory.

First, display of problems

After clicking WordPress background appearance theme, we will see this interface.

 Solve the problem that the WordPress program cannot switch the installation theme in the background

We can only see the current theme, not other themes under the theme directory, let alone switch to start other themes. In addition, the current topic does not have permission to edit, which should be caused by a component's permission restriction.

Second, solutions

To solve this problem, Lao Zuo has previously shared the limitation on the scandir function. We can remove this limitation.

1、 vi /usr/local/php/etc/php.ini

2. Find the disable_functions line

 Find the disable_functions line

3. Delete the scandir function location, as shown in the figure above. Because the default package of LNMP is directly limited during installation, it should not be started because of security issues. If we need to or do not understand the purpose of this function, we can add this function after we start the current theme. However, when editing the theme in the future, we need to FTP to the local.

4. Restart PHP to take effect

/etc/init.d/php-fpm restart

Finally, let's check the effect and return to the theme menu.

 Solve the problem that the WordPress program cannot switch the installation theme in the background

So far, we have solved this problem.

Vote for you
Domain name host preferential information push QQ group: six hundred and twenty-seven million seven hundred and seventy-five thousand four hundred and seventy-seven Get preferential promotion from merchants.
Like( zero )
Do not reprint without permission: Lao Zuo's Notes » Solve the problem that the WordPress program cannot switch the installation theme in the background