CURL redirect not working even with CURLOPT_FOLLOWLOCATION set to true



I was wondering if someone might be able to help me with this issue.
I have a feeling this has something to do with my host's server
settings as I used to be able to get CURL to follow redirects by
setting CURLOPT_FOLLOWLOCATION set to true. I had a problem with my
host's updating something in the past that gave me the error
"CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an
open_basedir is set". My host worked on the issue and the error went
away, but I still can't seem to follow redirects, but I don't receive
the error. When I turn on the headers it show the location redirect,
but it won't follow it. Any ideas or is this an issue again with my
host? One code example of this issue is below. I have been able to
manually redirect to a point, but it would be a lot easier if the CURL
option worked. Thanks for any help you can provide.


<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt");
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U;
Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1");
curl_setopt($ch, CURLOPT_URL, "http://www.flickr.com/signin/";);
curl_setopt($ch, CURLOPT_REFERER, "http://www.flickr.com/";);
curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type:
application/x-www-form-urlencoded"));
//curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_exec ($ch);

curl_close($ch);
?>
.



Relevant Pages

  • Re: CURL redirect not working even with CURLOPT_FOLLOWLOCATION set to true
    ... settings as I used to be able to get CURL to follow redirects by ... away, but I still can't seem to follow redirects, but I don't receive ... but it would be a lot easier if the CURL ... // close CURL resource, ...
    (comp.lang.php)
  • Re: CURL redirect not working even with CURLOPT_FOLLOWLOCATION set to true
    ... settings as I used to be able to get CURL to follow redirects by ... away, but I still can't seem to follow redirects, but I don't receive ... but it would be a lot easier if the CURL ... // close CURL resource, ...
    (comp.lang.php)
  • Re: redirects disappearing
    ... restore an old metabase file, since this information is stored in the ... May i also ask what tool you used to edit IIS settings? ... a few days ago all of these redirects vanished. ... > I haven't been able to reproduce the disappearing redirects however by testing various IP and security settings. ...
    (microsoft.public.inetserver.iis)
  • Re: CURL redirect not working even with CURLOPT_FOLLOWLOCATION set to true
    ... I have a feeling this has something to do with my host's server ... settings as I used to be able to get CURL to follow redirects by ... away, but I still can't seem to follow redirects, but I don't receive ... but it would be a lot easier if the CURL ...
    (comp.lang.php)
  • redirects disappearing
    ... so, if a user hits ... a few days ago all of these redirects vanished. ... One suggestion was that some settings, ... I haven't been able to reproduce the disappearing redirects however by ...
    (microsoft.public.inetserver.iis)