Page 1 of 1

how to set safe_mode on, or/and open_basedir in htaccess

Posted: Mon Feb 12, 2007 1:24 am
by siraj
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


I use CURL Function for importing the contact address but after executing my file it gives following error.

[b]Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/xxxx/public_html/myfolder/import/xx/test.php on line 37[/b]

my coding is

Code: Select all

$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL,"http://mail.google.com/mail/");
	curl_setopt($ch, CURLOPT_REFERER, "");
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);                                // Line 37
	curl_setopt($ch, CURLOPT_HEADERFUNCTION, 'read_header');
please help me how to debug this prob..


and one more important thing is if my setup is on a shared hosting account then how i debug this problem through htacces or php.ini

Please Help me any one

Thanx in Advance


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Mon Feb 12, 2007 9:13 am
by feyd
The error is saying that safe_mode and/or open_basedir are on/set.

You will likely have to parse the location header out of the return data yourself then.

Posted: Fri Mar 09, 2007 11:28 pm
by anjanesh
Would this work ?

Code: Select all

ini_set("safe_mode", "1");
ini_set("open_basedir", NULL);

$ch = curl_init(); 
.
.
.
curl_exec($ch);