0
Well what I intended was to know what was the country of a certain IP, I already used PHP geoiplocation, however when I start running on my server appears to me the following error:
Fatal error: Call to undefined function geoip_country_name_by_name() in C:\Program Files\VertrigoServ\www\ExtraGrana\new\testando.php on line 4
When I put it on my Cpanel server, the following message appears: The "my site url" page is not working."
<?php
$country = geoip_country_name_by_name('www.google.com');
echo $country;
?>
What’s wrong with this code?
Thank you.
Is installing this on Linux hard to do? There is no easier alternative?
– Gonçalo
yum install php-Pear
– Ricardo Mota
You can try to get the IP with JS. But if you want with PHP I know no other way.
– Ricardo Mota
The IP I know pick, I wanted was the name of the country of that particular IP.
– Gonçalo
So. If you use PECL you can get the name using geoip_country_name_by_name
– Ricardo Mota