Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

All of my external connections needs to go through a proxy, so for my user I've added this line to allow me to wget or yum freely


export http_proxy=

The part above works great, but for a PHP script I have, I'm trying to use php_curl to fetch a file, so I'm defining the same proxy there too:

curl_setopt($curlHandle, CURLOPT_URL, '');
curl_setopt($curlHandle, CURLOPT_HTTPPROXYTUNNEL, true);
curl_setopt($curlHandle, CURLOPT_PROXYPORT, 8080);
curl_setopt($curlHandle, CURLOPT_PROXY, '');

echo $out;

However, I don't see any results, and for some strange reason when I netstat -n while running the script, I can see the connection the script is trying to make, which is the strange part:

tcp        0      0                TIME_WAIT

So instead of connecting to it's connecting to on a random port, and the source port on local is 80?

Any ideas?

Note: running CentOS 5.6

share|improve this question
That's not a connection in progress - it's one that was recently closed. Does the script return immediately or hang? –  Brian Mar 27 '12 at 14:36
@Brian returns immediately –  user838437 Mar 27 '12 at 14:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.