Take the 2-minute tour ×
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

~/.bashrc

export http_proxy=http://10.50.24.125:8080/

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:

$curlHandle=curl_init();
curl_setopt($curlHandle, CURLOPT_URL, 'http://www.google.com');
curl_setopt($curlHandle, CURLOPT_HTTPPROXYTUNNEL, true);
curl_setopt($curlHandle, CURLOPT_PROXYPORT, 8080);
curl_setopt($curlHandle, CURLOPT_PROXY, '10.50.24.125');

$out=curl_exec($curlHandle);
echo $out;
curl_close($curlHandle);

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 10.50.25.83:80              10.20.5.15:51194            TIME_WAIT

So instead of connecting to 10.50.24.125:8080 it's connecting to 10.20.5.15 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

 
discard

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

Browse other questions tagged or ask your own question.