wordpress編輯主題時報錯Warning: scandir() has been disabled for security reasons in


在ubuntu下面安裝了一個wordpress程序,在后台什么都沒干,編輯主題時,發現頁面中報下面的錯誤。

notice: /home/wwwroot/test.localhost/wordpress/wp-content/themes is not readable in /home/wwwroot/test.localhost/wordpress/wp-includes/theme.php on line 447 Warning: scandir() has been disabled for security reasons in /home/wwwroot/test.localhost/wordpress/wp-includes/l10n.php on line 764

這個是什么情況呢,趕快到網上搜了一下。

原來是scandir被禁用了。通過lnmp探針也可以看到。

很簡單,編輯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重啟下

 

等重啟完后,再刷新頁面,就會發現以前報的警告沒有了。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM