开发者

php replacement for safe_mode

开发者 https://www.devze.com 2023-01-08 23:02 出处:网络
i am new to lea开发者_如何学JAVArning PHP and so I\'ve installed the latest version (5.3.3) and am writing some code. i have run across this error:

i am new to lea开发者_如何学JAVArning PHP and so I've installed the latest version (5.3.3) and am writing some code. i have run across this error:

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

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 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...)

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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消