服务器系统更换为CentOS后,重新安装了一个wordpress程序,在后台什么都没干,发现页面中报出Warning: scandir() has been disabled for security reasons in …. 各种错误警告!

这是什么情况?赶快到网上搜了一下。

原来是scandir被禁用了。通过PHP探针也可以看到。

很简单,编辑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即可。

 

php.ini 的位置:/usr/local/php/etc/php.ini

最后执行/etc/init.d/php-fpm restart重启下

 

等重启完后,再刷新页面,就会发现以前报的警告没有了。

» WordPress报错Warning: scandir() has been disabled for security reasons in解决方案

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