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

服务器系统更换为CentOS后,重新安装了一个wordpress程序,在后台什么都没干,发现页面中报出Warning: scandir() has been disabled fo…

WordPress

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

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

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

090001176632767

很简单,编辑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重启下

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

本文来自网络,不代表24小时课堂在线立场,转载请注明出处:https://www.24ketang.cn/3110.html

为您推荐

返回顶部