春哥親測可用。
安裝Wordpress偶爾會出現(xiàn)Warning: scandir()問題,分享一下解決方法:
Warning: scandir() has been disabled for security reasons in /home/wwwroot/…
Warning: Invalid argument supplied for foreach() in /home/wwwroot/…
錯誤。開始以為是文件權(quán)限問題,檢查下來結(jié)果發(fā)現(xiàn)不是,改了權(quán)限沒有生效,后來打開探針,發(fā)現(xiàn)原來是因為php里面的scandir函數(shù)被禁用了。
解決辦法:
打開php.ini(路徑:/usr/local/php/etc/php.ini),找到這行:
disable_functions = scandir,passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,
proc_get_statu,ini_alter,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,
readlink,symlink,popepassthru,stream_socket_server,fsocket,fsockopen
去掉scandir保存并重起php-fpm即可。
很多函數(shù)問題,都有可能是php禁用了,大家需要的時候去掉就可以了,為了安全盡量少開啟!



皖公網(wǎng)安備 34010202600669



