Could not connect to API server

  • Ads

Could not connect to API server

Postby PerCompLLC » Fri May 07, 2010 7:26 pm

I've implemented IPInfoDB on a Wordpress installation for a client. Everything works perfectly in my development and staging environment, but in production (Media Temple), the code is unable to connect to the API Server.

Needless to say, the code in development, staging and production is identicle...

Array ( [0] => Could not connect to API server. Will try backup server in xxxxx.com/html/geolocation.class.php(321) Trace : #0 xxxxx.com/html/geolocation.class.php(258): geolocation->_query()

Any ideas?
PerCompLLC
 
Posts: 2
Joined: Fri May 07, 2010 7:19 pm

Re: Could not connect to API server

Postby marchost » Sun May 09, 2010 8:06 am

Hi, remplace all occurence of @file_get_contents by file_get_contents in the class. Sometimes file_get_contents is disabled in your php configuration, removing the @ should give you the warning. You could try this class : http://unix.freshmeat.net/projects/ipgeolocation-php-class that use cUrl instead of file_get_contents (I should release my own curl class soon)

Marc
marchost
Site Admin
 
Posts: 373
Joined: Wed Apr 08, 2009 9:55 pm

Re: Could not connect to API server

Postby PerCompLLC » Sun May 09, 2010 11:30 am

As it turns out, allow_url_fopen is disabled by default on the Media Temple servers... I edited php.ini for this particular instance and enabled it. Everything works now as expected. Thanks for responding!
PerCompLLC
 
Posts: 2
Joined: Fri May 07, 2010 7:19 pm

Re: Could not connect to API server

Postby marchost » Sun May 09, 2010 7:16 pm

Great to know that its working, enjoy!
marchost
Site Admin
 
Posts: 373
Joined: Wed Apr 08, 2009 9:55 pm


Return to IP geolocation API related



Who is online

Users browsing this forum: bhukkel, Yahoo [Bot] and 1 guest