刚刚看到@乐猪 说在后台使用主题编辑时报以下错误,打开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删掉;
重启相应服务!
VPS没配置好吧,虚拟主机一般都改不了PHP.ini配置
@Junan 是配置问题, 配置下就ok了~ 一般虚拟主机基本上都会支持~
VPS好麻烦,还是用主机简单。
@huangjun :mrgreen: 图折腾就VPS,安稳写内容就虚拟主机。
还是用空间吧, vps配置很麻烦