I have a function that pulls info from whitepages.com and it worked perfectly. I moved the code to a new server and now I am having a problem with curl and white pages only. I also access other sites using curl like zillow.com and it works fine.
the code im using is :
<?php
$ch3 = curl_init();
curl_setopt($ch3, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($ch3, CURLOPT_TIMEOUT, 15);
curl_setopt($ch3, CURLOPT_URL, "http://www.whitepages.com/name/john-smith/md");
curl_setopt($ch3, CURLOPT_RETURNTRANSFER, 1);
$output2 = curl_exec($ch3);
curl_close($ch3);
?>
<?=$output2;?>
I dont know if it is a problem with cURL or PHP or the server itself. PHP Version 5.3.17. older sever:PHP Version 5.2.4. it seems to work on every other server we have. I dont know if there is an option in php or cURL I need to turn on. thanks.
EDIT: here is the phpinfo in the curl section
cURL support enabled
cURL Information 7.24.0
Age 3
Features
AsynchDNS No
Debug No
GSS-Negotiate No
IDN Yes
IPv6 Yes
Largefile Yes
NTLM Yes
SPNEGO No
SSL Yes
SSPI No
krb4 No
libz Yes
CharConv No
Protocols dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtsp, smtp, smtps, telnet, tftp
Host x86_64-unknown-linux-gnu
SSL Version OpenSSL/1.0.0
ZLib Version 1.2.3
It is a dedicated server from gatorhost. I think it is linux-RedHat-9.8.2. and all it says is "couldn't connect to host"
We have confirmed the code works fine. (We ran a test from both hosts). There is something on the host itself that is blocking access to whitepages. cURL is enabled, we attempted using an alternate port (ie... 8080). Also, tried establishing the specific browser headers and user agent (from the following post) Can servers block curl requests?
Nothing we have established seems to make any bit of difference.... We are also thinking it is a firewall issue, but we checked locally here and there is not a problem. I can only think that it is blocked on the server. We have a "reseller" dedicated server, access to php.ini, etc...