Curl Proxy Issues - Can't Figure This One Out - "cURL Error (7): couldn't connect to host"

cody41

Power Member
Joined
Jun 18, 2009
Messages
691
Reaction score
276
I've got php code that utilizes a random known GOOD google passed proxy to reach out and parse through google serps for keyword positioning. I've run this code on my developer's web server (which I believe is based in Taiwan if that matters) and the proxies work, and the google checkup works. Ok, so code proven out and proxies proven out.

What doesn't work is if I run the code from MY webserver in my Texas colocation or even off of my laptop at home running XAMPP. I get "cURL Error (7): couldn't connect to host" errors all the time.
It's not my connecttime, it's not that it's a bad proxy and my outbound ports are not blocked (especially at home!). Any ideas?
 
Some questions that should help to pinpoint the issue:
1) The proxy - are you connecting to it by IP address or hostname?
2) Are you able to connect to the proxy manually from your server?
3) Are you sure that you have error_reporting and display_errors both set properly on your server?
4) Are the two configurations identical (namely, php.ini)?


If the answer to 1 is hostname, try manually resolving it and connecting to the IP instead to see if that fixes it.


If you're unsure about #2, try this (can't paste code directly due to filters):
Code:
pastebin[i].[/i]co[b]m[/b][b]/[/b]7vim9Zxt


If you're unsure of #3, at the top of the PHP script, add the following:
Code:
 [b]/[/b][b]/[/b] TURN ON ERROR REPORTING
ini_set("display_errors", "On");
ini_set("log_errors", "On");
error_reporting(E_ALL);


Lastly, if you're unable to connect to the proxy using sockets/etc, try to ping it and see what your results are (assuming it responds to ping from the developer's machine as well).
 
Back
Top