curl-and-php
curl, redirection and ports
Date: Thu, 22 Sep 2005 17:14:41 -0500
I have a following php script:
set_time_limit(0);
$ch = curl_init();
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,true);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_MAXREDIRS,100);
curl_setopt($ch,CURLOPT_URL,"h**p://www.mtsu.edu/~devstud2/DSM080.html");
$buffer = curl_exec($ch);
if (curl_errno($ch) == CURLE_OK )
{
echo $buffer;
}
else
{
echo "no";
}
curl_close($ch);
the sample url redirects to another one - I tried the script on
different servers - on some it works fine, following the redirect, on
others it reports "Cannot find server or DNS Error".
This is what I got from the support staff on the site where the script
doesn't work:
"We do not open non-standard ports (neither ingress or egress). You will
not be able to communicate with any host on port 11064 (or any
non-standard port). Port 80 (the standard Web Server port) would,
however, be
acceptable."
Inserting this line:
curl_setopt($ch,CURLOPT_PORT,80);
did not change anything
If you have any idea what could be causing the error, please let me know
Thanks
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2005-09-23