Jump to content

CURLOPT_FOLLOWLOCATION


floppydrivez

Recommended Posts

I am trying to fetch some data from a site.  As long as the site doesn't redirect it works fine, but if it does then it goes to poo.  So to counteract the problem I set FOLLOWLOCATION.

 

/*we first retrieve the contente of the page using the Curl library*/
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_FILETIME, 1);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 2);

$store = curl_exec ($ch);

 

Which produces this error

 

Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in home/myfolder/

 

I have had no luck with a fix or work around.  Any suggestions?

Link to comment
https://forums.phpfreaks.com/topic/66370-curlopt_followlocation/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.