1. 程式人生 > >lnmp -- 解決Warning: scandir() has been disabled for security reasons in…的問題

lnmp -- 解決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

解決方法:
lnmp環境中編輯PHP配置檔案:

vi /usr/local/php/etc/php.ini進入編輯狀態

輸入/,進入搜尋模式,找到disable_functions

尋找disable_functions字串,將後面的scandir刪除

重啟PHP生效

/etc/init.d/php-fpm restart
--------------------- 
作者:趙公子記 
來源:CSDN 
原文:https://blog.csdn.net/github_36700243/article/details/62430470 
版權宣告:本文為博主原創文章,轉載請附上博文連結!