wordpress PHP Warning: scandir() has been disabled for security reasons解决方法

[Fri Oct 27 09:24:28.443954 2017] [:error] [pid 14521] [client 42.236.10.81:50407] PHP Warning:  scandir() has been disabled for security reasons in /var/webdata/......

[Fri Oct 27 09:24:28.444009 2017] [:error] [pid 14521] [client 42.236.10.81:50407] PHP Warning:  Invalid argument supplied for foreach() in /var/webdata//......

原因:php里面的 scandir() 函数被禁用

解决方法:编辑php.ini,找到这行:

disable_functions = scandir,passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,fsockopen去掉scandir保存并重起php-fpm即可。

同样,如果是Warning: exec() has been disabled for security reasons in /home/wwwroot/…或者为其它函数,解决办法也是一样的。

你可能感兴趣的:(wordpress PHP Warning: scandir() has been disabled for security reasons解决方法)