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

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
siraj
Forum Newbie
Posts: 2
Joined: Mon Feb 12, 2007 12:56 am

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

Post 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]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Would this work ?

Code: Select all

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

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