All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Random php5-curl problem
I'm sure someone here can point me in the right direction. I'm having a little trouble with php5-curl. socks5 proxies don't seem to work.
The socks5 proxies I'm trying work find on the command line with curl actual. When using them inside php, no dice.
The following works:
<?php //$proxy = 'xxx.xxx.xxx.xxx:xxxxx'; $url = 'http://automation.whatismyip.com/n09230945.asp'; $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); //curl_setopt($curl, CURLOPT_PROXY, $proxy); //curl_setopt($curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5); echo curl_exec($curl); curl_close($curl); ?>
With the commented lines uncommented, nothing. It just hangs until it eventually times out.
`php prox.php
- About to connect() to proxy xxx.xxx.xxx.xxx port xxxxx (#0)
- Trying xxx.xxx.xxx.xxx... * connected
`
Like I say, the proxy works A-OK with command line curl.
What could be wrong? Anyone experienced it before?
Comments
Seems an issue with socks 5, your code is working fine
php5-curl (well, libcurl) and cli curl versions match?
I am trying with a SSH tunnel. Is working o_O
curl --version curl 7.21.0 (i486-pc-linux-gnu) libcurl/7.21.0
and from phpinfo:
cURL support enabled
cURL Information 7.21.0
Buggered if I know what the problem is.
Are you trying to write a script for dynamic dns?
Nope.
It seems that this is a name resolving issue. I think you should use local name server. Go install pdnsd and change your nameserver to 127.0.0.1
Oh, thanks. I'll give that a go. Fingers crossed!
How was it?
Is port xxxxx unblocked on the servers firewall for outgoing tcp connections?
@1q1 - haven't had a chance to check, I'm busy on other projects right now.
@ Asad - it works from the command line.