首页 php教程 php手册 Warning: chmod() has been disabled for security reasons in

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

Jun 13, 2016 am 10:12 AM
chmod for has security warning

Warning: chmod() has been disabled for security reasons in D:\\freehost\\xxx\\WindFile.php on line 102根据英文的意思我们知道是出于安全原因,已被禁用的chmod()了,那么解决办法就是很简单了,直接把chmod()禁用关了就可以了。

如果你有服务器权限操作方法很简单打开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))
    {
        //不再需要通过_at方法来抵制错误
        //错误被屏蔽时就不抛出异常,该处理就允许你在代码中照常使用error_reporting来控制错误报告
        return true;
    }


第二步:找到eccore/ecmall.php

 代码如下 复制代码

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;
}

修改为

 代码如下 复制代码

function _at($fun)
{
    $arg = func_get_args();
    unset($arg[0]);
    $ret_val = @call_user_func_array($fun, $arg);

    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

本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

AI Hentai Generator

AI Hentai Generator

免费生成ai无尽的。

热门文章

R.E.P.O.能量晶体解释及其做什么(黄色晶体)
1 个月前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳图形设置
1 个月前 By 尊渡假赌尊渡假赌尊渡假赌
威尔R.E.P.O.有交叉游戏吗?
1 个月前 By 尊渡假赌尊渡假赌尊渡假赌

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

解决kernel_security_check_failure蓝屏的17种方法 解决kernel_security_check_failure蓝屏的17种方法 Feb 12, 2024 pm 08:51 PM

Kernelsecuritycheckfailure(内核检查失败)就是一个比较常见的停止代码类型,可蓝屏错误出现不管是什么原因都让很多的有用户们十分的苦恼,下面就让本站来为用户们来仔细的介绍一下17种解决方法吧。kernel_security_check_failure蓝屏的17种解决方法方法1:移除全部外部设备当您使用的任何外部设备与您的Windows版本不兼容时,则可能会发生Kernelsecuritycheckfailure蓝屏错误。为此,您需要在尝试重新启动计算机之前拔下全部外部设备。

PHP Warning: Invalid argument supplied for foreach() - 解决方案 PHP Warning: Invalid argument supplied for foreach() - 解决方案 Aug 26, 2023 pm 09:42 PM

PHPWarning:Invalidargumentsuppliedforforeach()-解决方案在使用PHP开发网页或应用程序时,经常会遇到各种错误和警告。其中一个常见的警告是“Invalidargumentsuppliedforforeach()”,它通常在使用foreach循环遍历数组时产生。这个问题看起来很简单,但是如果不

如何解决PHP Warning: fopen(): SSL operation failed in file.php on line X 如何解决PHP Warning: fopen(): SSL operation failed in file.php on line X Aug 25, 2023 am 09:22 AM

如何解决PHPWarning:fopen():SSLoperationfailedinfile.phponlineX在PHP编程中,我们经常使用fopen函数来打开文件或者URL,并进行相关操作。然而,在使用fopen函数时,有时候会遇到类似于Warning:fopen():SSLoperationfailedinfile.p

如何解决PHP警告:file_get_contents():无法打开流:HTTP请求失败 如何解决PHP警告:file_get_contents():无法打开流:HTTP请求失败 Aug 18, 2023 pm 11:34 PM

如何解决PHPWarning:file_get_contents():failedtoopenstream:HTTPrequestfailed在进行PHP开发过程中,经常会遇到通过file_get_contents函数向远程服务器发起HTTP请求的情况。然而,有时候我们会遇到一个常见的错误提示:PHPWarning:file_get_c

Flask-Security: 在Python web应用程序中添加用户身份验证和密码加密 Flask-Security: 在Python web应用程序中添加用户身份验证和密码加密 Jun 17, 2023 pm 02:28 PM

Flask-Security:在Pythonweb应用程序中添加用户身份验证和密码加密随着互联网的不断发展,越来越多的应用程序需要用户身份验证和密码加密来保护用户数据的安全性。而在Python语言中,有一个非常流行的Web框架——Flask。Flask-Security是基于Flask框架的一个扩展库,它可以帮助开发人员在Pythonweb应用程序中轻

Win10如何卸载Skype for Business?电脑上的skype怎么彻底卸载方法 Win10如何卸载Skype for Business?电脑上的skype怎么彻底卸载方法 Feb 13, 2024 pm 12:30 PM

Win10skype可以卸载吗是很多用户们都想知道的一个问题,因为很多的用户们发现自己电脑上的默认程序上有这个应用,担心删除后会影响到系统的运行,下面就让本站来为用户们来仔细的介绍一下Win10如何卸载SkypeforBusiness吧。Win10如何卸载SkypeforBusiness1、在电脑桌面点击Windows图标,再点击设置图标进入。2、点击“应用”。3、在搜索框中输入“Skype”,点击选中找到的结果。4、点击“卸载”。5

PHP Warning: Invalid argument supplied for foreach()的解决方法 in PHP Warning: Invalid argument supplied for foreach()的解决方法 in Jun 22, 2023 pm 01:07 PM

近年来,PHP已成为网页开发的重要工具之一。然而,PHP也会出现一些错误信息,其中一个常见的错误是“Invalidargumentsuppliedforforeach()“错误。下面将介绍如何解决这个错误。首先,让我们了解一下什么是该错误。这个错误通常出现在使用foreach循环代码时,却给循环代码提供了无效的参数。在大多数情况下,这种错误会使程序崩

Nginx Proxy Manager安全性分析与防护 Nginx Proxy Manager安全性分析与防护 Sep 28, 2023 pm 01:30 PM

NginxProxyManager安全性分析与防护引言:在互联网应用中,安全性一直是至关重要的问题。作为一款强大的反向代理和负载均衡服务器软件,Nginx在保障网络应用安全上起着重要的作用。然而,随着互联网技术的不断发展,网络攻击日益增多,如何保障NginxProxyManager的安全性成为了亟待解决的问题。本文将从NginxProxyMana

See all articles