Warning: chmod() has been disabled for security reasons in_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 |
如果没有服务器权限,就只能从程序下手了,下面我以ecmall出现此问题的解决办法
第一步:找到eccore/controller/message.base.php
将
代码如下 | 复制代码 |
if ($errno == 2048) { return true; } |
替换为
代码如下 | 复制代码 |
if ($errno == 2048 || (($errno & error_reporting()) != $errno)) |
第二步:找到eccore/ecmall.php
代码如下 | 复制代码 |
function _at($fun) return $ret_val; |
修改为
代码如下 | 复制代码 |
function _at($fun) return $ret_val;
|
有些危险函数我们尽量在开发时就为避免掉了,免得以后要改,下面我列出一般服务器会禁止使用的函数有
代码如下 | 复制代码 |
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 |
推荐阅读
-
Warning: chmod() has been disabled for security reasons in_PHP教程
-
php出错:Warning: Phpinfo() Has Been Disabled For Security Reasons
-
php出错:Warning: Phpinfo() Has Been Disabled For Security Reasons
-
php报错:Warning: Phpinfo() Has Been Disabled For Security Reasons
-
Warning: set_time_limit() has been disabled for security reasons in /home/www/we解决办法
-
[ErrorException] proc_get_status() has been disabled for security reasons
-
PHP提示Warning:phpinfo() has been disabled函数禁用的解决方法,warningphpinfo_PHP教程
-
PHP提示Warning:phpinfo() has been disabled函数禁用的解决方法,warningphpinfo_PHP教程
-
Warning: chmod() has been disabled for security reasons in
-
Warning:chmod() has been disabled for security reasons in