Warning:chmod () has been disabled for security reasons in

Source: Internet
Author: User
Tags chmod


If you have server permissions The operation method is very simple to open php.ini, find this line:


The code is as follows

Disable_functions =


Add the function you want to disable in the back, such as disabling multiple functions, using a half-width comma to separate



Give an example:


The code is as follows

Disable_functions = Passthru,exec,system,popen,chroot,scandir,chgrp,chown,escapesh

Ellcmd,escapeshellarg,shell_exec,proc_open,proc_get_status


If you do not have server permissions, you can only start from the program, the following I ecmall the solution to this problem



First step: Find eccore/controller/message.base.php
Will


The code is as follows
if ($errno = = 2048)
{
return true;
}


Replaced by


The code is as follows

if ($errno = = 2048 | | (($errno & Error_reporting ())!= $errno))
{
No longer need to pass the _at method to resist the error
When an error is masked, it does not throw an exception, which allows you to use error_reporting in your code as usual to control error reporting
return true;
}



Step Two: Find eccore/ecmall.php


The code is as follows

function _at ($fun)
{
$arg = Func_get_args ();
unset ($arg [0]);
Restore_error_handler ();
$ret _val = @call_user_func_array ($fun, $arg);
Reset_error_handler ();

return $ret _val;
}


Amended to


The code is as follows

function _at ($fun)
{
$arg = Func_get_args ();
unset ($arg [0]);
$ret _val = @call_user_func_array ($fun, $arg);

return $ret _val;


}


There are some dangerous functions we try to avoid when we are developing, lest we change later, I list the functions that the general server will forbid to use.


The code is as follows

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.