floppydrivez Posted August 23, 2007 Share Posted August 23, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/66370-curlopt_followlocation/ Share on other sites More sharing options...
trq Posted August 23, 2007 Share Posted August 23, 2007 I think your out of luck. Quote Link to comment https://forums.phpfreaks.com/topic/66370-curlopt_followlocation/#findComment-332103 Share on other sites More sharing options...
floppydrivez Posted August 23, 2007 Author Share Posted August 23, 2007 To unset openbase_dir wouldn't be the answer for security reasons right? Quote Link to comment https://forums.phpfreaks.com/topic/66370-curlopt_followlocation/#findComment-332106 Share on other sites More sharing options...
trq Posted August 23, 2007 Share Posted August 23, 2007 Oh, if you have access to such settings its perfectly safe to enable it. Quote Link to comment https://forums.phpfreaks.com/topic/66370-curlopt_followlocation/#findComment-332116 Share on other sites More sharing options...
floppydrivez Posted August 23, 2007 Author Share Posted August 23, 2007 I think the error says I should disable it. I will have a look around. Quote Link to comment https://forums.phpfreaks.com/topic/66370-curlopt_followlocation/#findComment-332129 Share on other sites More sharing options...
trq Posted August 23, 2007 Share Posted August 23, 2007 The error states that your open_basedir setting is limitted to the current directory. If you set open_basedir to blank, it defaults to allow all. Quote Link to comment https://forums.phpfreaks.com/topic/66370-curlopt_followlocation/#findComment-332131 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.