很多新手安装PHP环境之后,安装Wordpress的时候会出现这个

Warning: scandir() has been disabled for security reasons in /home/wwwroot/…

Warning: Invalid argument supplied for foreach() in /home/wwwroot/…

错误,引起这个错误的原因是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

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。