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?
safe_modehad 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_modeoff, and design your code not to assume that it’s being used or disused. Please note thatsafe_modehas been removed as of PHP 5.4.0.Here’s more information on why
CURLOPT_FOLLOWLOCATIONwas disabled whensafe_modeoropen_basedirare in effect. Problems like this are one of the main reasons whysafe_modeis likely to be removed from PHP entirely.