Cannot redeclare geoip_country_code_by_name

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 file from

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:

The second solution: in your file, look for this code

and replace with



5 thoughts on “Cannot redeclare geoip_country_code_by_name

  1. Pingback: Cannot redeclare geoip_country_code_by_name | WebDev Blog

Leave a Reply

Your email address will not be published. Required fields are marked *