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

Trying to use curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, TRUE); but I'm getting this error. How can I overcome it?

Strawberry
  • 66,024
  • 56
  • 149
  • 197

2 Answers2

1

This is because your setup has either safe mode or open_basedir settings in the php.ini.

You need to change these settings in the php.ini to do this.

Mez
  • 24,430
  • 14
  • 71
  • 93
-1

Try adding

curl_setopt($ch, CURLOPT_HEADER, 0);
Adam Hopkinson
  • 28,281
  • 7
  • 65
  • 99
  • this one won't do the job. it's because of the server's setting. you should turn safe_mode and open_basedir off – Yasin Ergul Apr 29 '12 at 17:16