ErrorException [ Warning ]: file_get_contents(http://ipinfo.io/54.197.218.127): failed to open stream: HTTP request failed! HTTP/1.1 502 Bad Gateway

DOCROOT\application\classes\Controller\Home.php [ 72 ]

67     private function _define_lang()
68     {
69         $langCookie = Cookie::get('lang');
70         if (empty($langCookie)) {
71             $ip = $_SERVER['REMOTE_ADDR'];
72             $country = json_decode(file_get_contents("http://ipinfo.io/{$ip}"));
73             Request::factory('Lang/change_to/' . $country->country)->execute();
74             $langCookie = Cookie::get('lang');
75         }
76         $lang = $this->request->param('lang', $langCookie);
77         // check the allowed languages, and force the default
  1. {PHP internal call} » Kohana_Core::error_handler(arguments)

  2. DOCROOT\application\classes\Controller\Home.php [ 72 ] » file_get_contents(arguments)

  3. DOCROOT\application\classes\Controller\Home.php [ 9 ] » Controller_Home->_define_lang()

  4. DOCROOT\system\classes\Kohana\Controller.php [ 69 ] » Controller_Home->before()

  5. {PHP internal call} » Kohana_Controller->execute()

  6. DOCROOT\system\classes\Kohana\Request\Client\Internal.php [ 97 ] » ReflectionMethod->invoke(arguments)

  7. DOCROOT\system\classes\Kohana\Request\Client.php [ 114 ] » Kohana_Request_Client_Internal->execute_request(arguments)

  8. DOCROOT\system\classes\Kohana\Request.php [ 990 ] » Kohana_Request_Client->execute(arguments)

  9. DOCROOT\modules\router\classes\Controller\Router.php [ 35 ] » Kohana_Request->execute()

  10. DOCROOT\system\classes\Kohana\Controller.php [ 84 ] » Controller_Router->action_index()

  11. {PHP internal call} » Kohana_Controller->execute()

  12. DOCROOT\system\classes\Kohana\Request\Client\Internal.php [ 97 ] » ReflectionMethod->invoke(arguments)

  13. DOCROOT\system\classes\Kohana\Request\Client.php [ 114 ] » Kohana_Request_Client_Internal->execute_request(arguments)

  14. DOCROOT\system\classes\Kohana\Request.php [ 990 ] » Kohana_Request_Client->execute(arguments)

  15. DOCROOT\index.php [ 118 ] » Kohana_Request->execute()

Environment