Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhyunfe/6af8cd44619a20d786d4b590489d1f02 to your computer and use it in GitHub Desktop.
Save zhyunfe/6af8cd44619a20d786d4b590489d1f02 to your computer and use it in GitHub Desktop.
解决Warning: scandir() has been disabled for security reasons in…的问题
原因:LNMP 0.9禁用了部分存在危险的PHP函数
LNMP0.9禁用的PHP函数包括:passthru, exec, system, chroot, scandir, 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
解决方法:
编辑PHP配置文件:
vi /usr/local/php/etc/php.ini进入编辑状态
输入/,进入搜索模式,找到disable_functions
寻找disable_functions字符串,将后面的scandir删除
重启PHP生效
/etc/init.d/php-fpm restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment