5

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?

hakre
  • 193,403
  • 52
  • 435
  • 836
Micku
  • 550
  • 4
  • 9
  • 23

2 Answers2

6

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

David
  • 2,365
  • 8
  • 34
  • 59
5

you need the PECL extension, have a look here http://www.php.net/manual/en/geoip.installation.php

baptme
  • 10,062
  • 3
  • 52
  • 57