Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make geoip_country_name_by_name() work?

Tags:

php

geoip

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?

like image 415
Micku Avatar asked Feb 20 '23 07:02

Micku


2 Answers

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

like image 190
David Avatar answered Feb 22 '23 22:02

David


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

like image 45
baptme Avatar answered Feb 22 '23 22:02

baptme