This is the warning.
Warning: curl_setopt_array() [function.curl-setopt-array]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /.../file.php on line 41
This is what I am using to detect cURL. If cURL isn't enabled a work around is triggered.
function curlEnabled() {
if (ini_get('safe_mode') == 1)
return 0;
return in_array('curl', get_loaded_extensions());
}
I am finding it very difficult to test this function effectively do to a lack of hosting with safe mode enabled or cURL disabled.
Could someone tell me.
- Does the function actually detect PHP safe_mode?
- It detects whether cURL is loaded right?
Finally, how would this function be improved to catch the 'cannot be activated' error and return 0?