Forum Moderators: coopster
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 must have something with PHP settings - if you have any idea what could be causing the error, please let me know
Thanks
"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."
So if I understood this correctly, the problem doesn't have to do anything with curl or the fact that the url redirects - the site in question is simply sending the data to the port that my host is not listening to. Is that a correct interpretation?
If so, would you have any idea roughly what percentage of sites use such non-standard ports (and why would they do that). If it is generally known that it is a small number of sites, that wouldn't bother me, but if it will disable me from accessing a very large percentage of sites I try to access, I will need to find another hosting company.
Have you tried adding:
curl_setopt($ch,CURLOPT_PORT,80); to your script? That should force cURL to use port 80 ... even if it is insecure.
Re: why a hosting company would close most of the ports ... security. There aren't many ports that most normal servers need to use, so one thing an admin can do to increase the security of any box is to close most of the ports. There are ~65,000 ports per box, and maybe 5 of them would be used a lot. Different processes would open their own ports as needed, like HTTPD might need a bunch of ports to handle web traffic and start using a limited range of ports to handle the connections. Your provider has probably left open around 200-500 ports for this purpose, but those in the upper ranges, often used by secure or oddball processes are usually "safe" to close. cURL is probably using port 11064 as a security measure of its own, but you may be able to force it to use port 80 (or some other lower range port) which might be open on your server.
[edited by: jatar_k at 12:38 am (utc) on Sep. 22, 2005]
[edit reason] linked it up [/edit]