防止PHP木马,应在PHP.INI里禁止的一些函数

disable_functions = system,passthru,exec,shell_exec,phpinfo,get_current_user,ini_restore,dl,scandir,popen,proc_open,opendir

其中opendir这个是文件浏览的重要函数,禁了这个,大部分PHP木马都没门了。

不过会对一些正常的PHP有时候会造成影响,但是不影响正常使用。比如DZ论坛的后台 文件校验、运行记录等。就有影响了。。。

更严格的一组限制函数
disable_functions = phpinfo,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,

get_current_user,leak,putenv,popen,opendir

原文地址:https://www.cnblogs.com/fogwang/p/2666593.html