tags:

views:

69

answers:

1

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 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?

+2  A: 

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.


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.

Charles