刚安装完成wordpress中文最新版4.9.6,上后台对文件编辑发现以下出错,
scandir() has been disabled for security reasons in /wordpress/wp-includes/l10n.php
scandir() 函数,一查php.ini文件原来是scandir被禁用了
编辑php.ini文件
; This directive allows you to disable certain functions for security reasons. ; It receives a comma-delimited list of function names. This directive is ; *NOT* affected by whether Safe Mode is turned On or Off. ; http://php.net/disable-functions disable_functions = passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server
删除scandir保存
; http://php.net/disable-functions disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server
php.ini 的位置:
/usr/local/php/etc/php.ini
最后执行重启php-fpm进程
/etc/init.d/php-fpm restart
如果不能重启的,查看进程 ps -ef|grep php-fpm
/etc/init.d/php-fpm start
我没有办法重启,用
kill -9 xxxxx
杀进程后
/etc/init.d/php-fpm start
重启完后,退出重新登录任意刷新,警告消失。