禁用php函数的设置

  打开PHP.INI,找到这行:

disable_functions =

 

在后面那里加上要禁用的函数,如禁用多个函数,要用半角逗号 , 分开 

给个例子:

 

disable_functions = passthru,exec,system,popen,chroot,scandir,chgrp,chown,escapesh

 

ellcmd,escapeshellarg,shell_exec,proc_open,proc_get_status

 

 

建议在主机上禁用的函数:

 

disable_functions =system,exec,shell_exec,passthru,proc_open,proc_close,proc_get_status,checkdnsrr,getmxrr,getservbyname,getservbyport,syslog,popen,show_source,highlight_file,dl,socket_listen,socket_create,socket_bind,socket_accept,socket_connect,stream_socket_server,stream_socket_accept,stream_socket_client,ftp_connect,ftp_login,ftp_pasv,ftp_get,sys_getloadavg,disk_total_space,disk_free_space,posix_ctermid,posix_get_last_error,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_strerror,posix_times,posix_ttyname,posix_uname,openlog,pfsockopen,ini_restore,ini_alter,chgrp,chown,scandir,chroot,r

 

 

 

 

 

 

在主机上面如何查看禁用的函数列表,我从网上找了一个非常不错的探针

 

http://www.yahei.net/tz/

 

 

 

 

 

你可能感兴趣的:(PHP)