Page 1 of 1

FTP cURL problem caused by SAFE MODE setting???

Posted: Sat Dec 30, 2006 10:28 am
by alex.barylski
I am getting this error on a client server...SAFE MODE is OFF...however open_basedir is set to the following: /home/lgadmin/:/usr/lib/php:/usr/local/lib/php:/tmp

Error:

Code: Select all

CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an
open_basedir is set in /home/lgadmin/public_html/temp/index.php on line
1866
Code:

Code: Select all

if (function_exists('curl_init')) {
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
I've read the docs on open_basedir, etc...but it doesn't say anything about cURL functions not working with SAFE MODE on or when open_basedir, etc...

What the heck? Any ideas? It's a shared host so I'm limited in what I can do with the server...

Cheers :)

Posted: Sat Dec 30, 2006 11:10 am
by Buddha443556
There was a security problem with CURLOPT_FOLLOWLOCATION and open_basedir as I recall.
from the PHP 5.2.0 Change Log:

Disabled CURLOPT_FOLLOWLOCATION in curl when open_basedir or safe_mode are enabled. (Stefan E., Ilia)
Does it work with CURLOPT_FOLLOWLOCATION set to false?

Posted: Sat Dec 30, 2006 3:26 pm
by alex.barylski
I didn't try that...I just suppressed the error which appears to have done the trick...

Thanks :)