How to make geoip_country_name_by_name() work?

Micku picture Micku · May 30, 2012 · Viewed 30.1k times · Source

I want to collect country name of an user who logined to my site. So i used

geoip_country_name_by_name() php function for this purpose.

But i got a fatal error as :

Fatal error: Call to undefined function geoip_country_name_by_name()

How can i avoid this error ?

Is there any other method to get country name using php?

Can someone help me please?

Answer

David picture David · May 30, 2012

Sounds like the extension is not installed on your computer. Check out this link, it is a PECL extension.

http://www.php.net/manual/en/geoip.setup.php