oracle765 Posted December 11, 2017 Share Posted December 11, 2017 (edited) Hi professionals I am experiencing a huge generating error log file with the following output and error [04-Dec-2017 19:14:44 Australia/Brisbane] PHP Warning: simplexml_load_file(): I/O warning : failed to load external entity "<?xml version="1.0" encoding="UTF-8"?> <geoPlugin> <geoplugin_request>62.210.201.88</geoplugin_request> <geoplugin_status>206</geoplugin_status> <geoplugin_credit>Some of the returned data includes GeoLite data created by MaxMind, available from <a href='http://www.maxmind.com'>http://www.maxmind.com</a>.</geoplugin_credit> <geoplugin_city></geoplugin_city> <geoplugin_region></geoplugin_region> <geoplugin_areaCode>0</geoplugin_areaCode> <geoplugin_dmaCode>0</geoplugin_dmaCode> <geoplugin_countryCode>FR</geoplugin_countryCode> <geoplugin_countryName>France</geoplugin_countryName> <geoplugin_continentCode>EU</geoplugin_continentCode> <geoplugin_latitude>48.8582</geoplugin_latitude> <geoplugin_longitude>2.3387</geoplugin_longitude in public_html/files/currency/currency_converter.php on line 18 Here is some of the code in the currency_converter.php file lines 11 through to 26 if(isset($_SESSION['currency_code']) && empty($_SESSION['currency_code'])){ unset($_SESSION['currency_code']); } if(!isset($_SESSION['currency_code']) && empty($_SESSION['currency_code'])){ $xml = simplexml_load_file("http://www.geoplugin.net/xml.gp?ip=".$ip); $ip_currency = (string)$xml->geoplugin_currencyCode ; $currency_symbol=(string)$xml->geoplugin_currencySymbol; $geo_currency_code=(string)$xml->geoplugin_currencyCode; $_SESSION['currency_symbol']=$currency_symbol; $_SESSION['currency_code']=$geo_currency_code; if(empty($xml)){ // If GeoPlugin Limit Exceeds use default $_SESSION['currency_symbol']='$'; $_SESSION['currency_code']='AUD'; } } I did not write this and i am not sure what to do to fix it. Any ideas Edited December 11, 2017 by oracle765 Quote Link to comment https://forums.phpfreaks.com/topic/305893-php-io-warning/ Share on other sites More sharing options...
requinix Posted December 11, 2017 Share Posted December 11, 2017 It suggests their XML isn't quite valid. Can you post the XML you received? Use [code] tags so the forum doesn't try to add links and whatnot to it. Quote Link to comment https://forums.phpfreaks.com/topic/305893-php-io-warning/#findComment-1554590 Share on other sites More sharing options...
gizmola Posted December 11, 2017 Share Posted December 11, 2017 I don't think there is a problem. That is a warning that can occur anytime the code fails to get a return from the REST server. The code already handles that and defaults the currency to 'AUD'. In summary this is a naturally occurring situation that the code handles. You can ignore the warning unless this is happening on every single request. At that point there might be an issue with access to Geoplugin.net, which is possible given that they blacklist people for going over their allowable use. See their faq for more: http://www.geoplugin.com/faq They have a tool you can use to see if you are blacklisted. The FAQ also states that it is possible to get on the blacklist if you don't catch bots that might call your page, and that you need to avoid those situations with code. You can also pay them to whitelist your site. Quote Link to comment https://forums.phpfreaks.com/topic/305893-php-io-warning/#findComment-1554597 Share on other sites More sharing options...
oracle765 Posted December 18, 2017 Author Share Posted December 18, 2017 thanks for that i will contact them Quote Link to comment https://forums.phpfreaks.com/topic/305893-php-io-warning/#findComment-1554735 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.