Hi, I was finishing my script and suddenly libcurl stopped working. I thought the server I was connecting to was down or something, but invariably of where I try to connect I get the same sucky error. I even tried rebooting my box, same results. The code snippet where things happen is:
public function navigate(array $data)
{
$ch = curl_init();
// Setup cURL
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_INTERFACE, $data['ip']);
curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/cookies.jar");
curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/cookies.jar");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $data['agent']);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
// Visit homepage
curl_setopt($ch, CURLOPT_URL, "SOMEWEBSITEHERE, MAKES NO DIFFERENCE");
$page= curl_exec($ch);
var_dump($page, curl_error($ch), curl_errno($ch));
}
The above var_dump() will produce this output (with www.yahoo.com as the URL):
bool(false)
string(51) "Failed to connect to 69.147.76.15: Unknown error 22"
int(7)
Login failed!
I even tried sniffing the connection with wireshark, cURL doesn't even issue a connection request; only a DNS request.
I'm clueless right now.
I would really appreciate a hand with this.
Thanks.