Jump to content

PHP I/O warning


oracle765

Recommended Posts

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 &lt;a href='http://www.maxmind.com'&gt;http://www.maxmind.com&lt;/a&gt;.</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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.