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

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

报这个错误的原因是因为scandir函数被禁用了,

解决办法:
找到php.ini,编辑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重启下

 

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

Read More