WordPress 后台-外观-编辑 提示Warning: scandir() has been disabled错误的解决方法

安装了wordpress网站程序之后在打开外观-编辑(模版编辑)的时候出现了错误,提示信息如下:

Warning: scandir() has been disabled for security reasons in /home/wwwroot/yourdomain.com/wp-includes/class-wp-theme.php on line 978

Warning: Invalid argument supplied for foreach() in /home/wwwroot/yourdomain.com/wp-includes/class-wp-theme.php on line 981

Warning: scandir() has been disabled for security reasons in /home/wwwroot/yourdomain.com/wp-includes/class-wp-theme.php on line 978

Warning: Invalid argument supplied for foreach() in /home/wwwroot/yourdomain.com/wp-includes/class-wp-theme.php on line 981

在网上找了一下问题答案,原来是PHP禁用了scandir() 函数

解决方法如下:

打开php.ini文件中找到disable_functions 字符串,在其后把 scandir 去掉,重新服务器。