Today I had this error on my Ubuntu Linux box
Fatal error: Cannot redeclare geoip_country_code_by_name()
The reason was that I have geoip extension enabled in my PHP configuration and also I used the geoip.inc file from maxmind.com.
The solution is very simple. Actually, there are two solutions:
First is to disable the geoip extension from your configuration. In /etc/php5/apache2/conf.d/geoip.ini comment the first line:
[sourcecode language=”bash”]
;extension=geoip.so
[/sourcecode]
The second solution: in your geoip.inc file, look for this code
[sourcecode language=”php”]
function geoip_country_code_by_name($gi, $name) {
…
}
function geoip_country_name_by_name($gi, $name) {
…
}
[/sourcecode]
and replace with
[sourcecode language=”php”]
if (!function_exists(‘geoip_country_code_by_name’)) {
function geoip_country_code_by_name($gi, $name) {
…
}
}
if (!function_exists(‘geoip_country_name_by_name’)) {
function geoip_country_name_by_name($gi, $name) {
…
}
}
[/sourcecode]
Thanks! I had the same problem and went with method 2, that fixed it 🙂
That’s working 😉 – thanks
Thanks ! you saved me !
Thanks! It Works