php替换safe_mode [英] php replacement for safe_mode

查看:134
本文介绍了php替换safe_mode的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新学习PHP的,所以我安装了最新版本(5.3.3),并编写一些代码。我遇到这个错误:

i am new to learning PHP and so I've installed the latest version (5.3.3) and am writing some code. i have run across this error:


PHP警告:curl_setopt()[function.curl-setopt]:CURLOPT_FOLLOWLOCATION不能激活safe_mode已启用或open_basedir设置在C:\Rush\dev\personal\Numina.Framework\Development\PHP库\ Numina.Framework\clsHttpUtil.php第47行

PHP Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in C:\Rush\dev\personal\Numina.Framework\Development\PHP Library\Numina.Framework\clsHttpUtil.php on line 47

当我查找safe_mode的文档时,它告诉我它已被弃用。为什么不推荐使用,我该如何解决这个错误?

When I look up the documentation for safe_mode it tells me that it is deprecated. why was it deprecated and what can i do to fix this error?

推荐答案

safe_mode 有良好的意图,但是执行不均衡。它已被弃用,因为它导致的问题比它解决的更多,而不是一个通用的安全解决方案。现在有更好的方法来实现应用程序环境保护(如FastCGI,suexec,chroots,jails,VPSes ...)

safe_mode had good intentions, but was implemented unevenly. It was deprecated because it caused more problems than it solved, and was not a general security solution. There are better ways to achieve application environment protection now (like FastCGI, suexec, chroots, jails, VPSes...)

您可以通过转动 safe_mode 关闭,并设计您的代码不要假设正在使用或废弃请注意, safe_mode 自PHP 5.4.0起已被删除

You can fix your error by turning safe_mode off, and design your code not to assume that it's being used or disused. Please note that safe_mode has been removed as of PHP 5.4.0.

这里是有关 safe_mode 为什么 CURLOPT_FOLLOWLOCATION open_basedir 有效。这样的问题是为什么 safe_mode 可能会完全从PHP中移除的主要原因之一。

Here's more information on why CURLOPT_FOLLOWLOCATION was disabled when safe_mode or open_basedir are in effect. Problems like this are one of the main reasons why safe_mode is likely to be removed from PHP entirely.

这篇关于php替换safe_mode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆