原因: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
解決方法:
lnmp環境中編輯PHP配置文件:
-
vi /usr/local/php/etc/php.ini進入編輯狀態
-
輸入/,進入搜索模式,找到disable_functions
-
尋找disable_functions字符串,將后面的scandir刪除
重啟PHP生效
/etc/init.d/php-fpm restart
原文來自趙公子記