cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

CURLOPT_FOLLOWLOCATION not working

From: Tomas Kapler <tomas_at_kapler.cz>
Date: Sat, 13 Oct 2007 22:57:28 +0200

I got a problem with CURLOPT_FOLLOWLOCATION on my server hosting - it
does not work (does not follow location). The same code on my
localhost works as a charm. This is an example code:

<?php
$ch = curl_init("http://google.com");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_exec($ch);
curl_close($ch);
?>

When I put this code on my hosting
(http://test.developstudio.com/test.php) it says
301 Moved
The document has moved here. > www.google.com

I have asked hosting admin to upgrade my curl to the latest version,
and it is there (http://test.developstudio.com/phpinfo.php)

I have googled several hours and tried many things and other settings,
but nothing has worked at all. The only what I have found is that
"may" be a problem with open_basedir which is set up on the hosting.
The problem is, that it cannot be changed (the hosting use PLESK
administration, and i have been told, that for security reasons plesk
automaticaly always set open_basedir even if changed manually).

I'm not sure if this is the reason, and I do not know how to solve it.
Is there any possibility to have curl working with open_basedir value?
Or is there any other way how can i get over it?

I (afaik) can't take header location and follow it with the second
step - the page i need to follow uses COOKIE, referrer etc. and it
would be probably very hard (for me impossible) to get over it, and
probably also slowest, what is also an issues as i need to pass it 350
000 times.

Than you for any hints.

Regards
Tomas
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2007-10-13