GeoIP: Cannot redeclare geoip_country_code_by_name()
-
I need to run piwik on the same server where I host my wordpress portal.
I am running ubuntu 13.04, thus I installed the following geoip components:sudo apt-get install php5-geoip php5-dev libgeoip-dev
Since then I get the following error in wordpress. I think it’s because wp-insert is trying to load geoip once again, although the module is already loaded in PHP.
PHP Fatal Error: Cannot redeclare geoip_country_code_by_name() in […]/wp-insert/includes/common/geoip/geoip.inc on line 438
Could you please include_once instead of including the geoip component? The problem is with a namespace conflict under geoip_country_code_by_name.
Some people suggest to put it within an if-statement like this:
if (!function_exists('geoip_country_code_by_name')){ function geoip_country_code_by_name($gi, $name) { $country_id = geoip_country_id_by_name($gi,$name); if ($country_id !== false) { return $gi->GEOIP_COUNTRY_CODES[$country_id]; } return false; } }
HTH
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘GeoIP: Cannot redeclare geoip_country_code_by_name()’ is closed to new replies.