看来我不能在新主机上使用@file_get_contents [重复]

This question already has an answer here:

I am using function (snippet from CSS Trics) to get country of the user based on IP. On localhost (on my computer) it is working without the problem, but once I transferred and tried website this is the error I am getting:

    Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Error contacting Geo-IP-Server' in
 /home/elsaorgr/public_html/application/core/MY_Controller.php:72 
Stack trace: #0 /home/elsaorgr/public_html/application/core/MY_Controller.php(47): MY_Controller->geo_check_ip('178.223.146.253') 
#1 /home/elsaorgr/public_html/application/core/MY_Controller.php(13): MY_Controller->_check_lang() 
#2 /home/elsaorgr/public_html/application/libraries/ends/Frontend_Controller.php(7): MY_Controller->__construct() 
#3 /home/elsaorgr/public_html/application/controllers/home.php(7): Frontend_Controller->__construct() 
#4 /home/elsaorgr/public_html/system/core/CodeIgniter.php(308): Home->__construct() 
#5 /home/elsaorgr/public_html/index.php(202): require_once('/home/elsaorgr/...') 
#6 {main} thrown in /home/elsaorgr/public_html/application/core/MY_Controller.php on line 72

Does this error have something to do with host settings? (I am using CodeIgniter 2.1)

</div>

I had a similar problem and hat was because of the resolver configuration. If you are using cpanel go to Networking setup > resolver configuration and set there the ips if not already set (you can use 8.8.8.8 and 8.8.4.4)