刚刚看到@乐猪 说在后台使用主题编辑时报以下错误,打开class-wp-theme.php查看得知是因为主机不支持scandir()函数。具体路径看你自己的安装。

Warning: scandir() has been disabled for security reasons in /home/wwwroot/xxx.com/wp-includes/class-wp-theme.php on line 978
Warning: Invalid argument supplied for foreach() in /home/wwwroot/xxx.com/wp-includes/class-wp-theme.php on line 981
Warning: scandir() has been disabled for security reasons in /home/wwwroot/xxx.com/wp-includes/class-wp-theme.php on line 978
Warning: Invalid argument supplied for foreach() in /home/wwwroot/xxx.com/wp-includes/class-wp-theme.php on line 981

解决办法:
若是自有主机或VPS,修改PHP.ini配置

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

而后找到disable_functions,把后面的scandir删掉;
重启相应服务!