To175 Posted February 5, 2015 Posted February 5, 2015 Hi, I need to have the country of the IP !Because In minecraft my plugin have to get the country from my url ! So, I see I could use : http://php.net/manual/fr/function.geoip-country-code3-by-name.phpBut I need : yum install php-pecl-geoip Thanks
wolstech Posted February 5, 2015 Posted February 5, 2015 I'm pretty sure this isn't as easy as you make it to be. I'll escalate this.
wolstech Posted February 5, 2015 Posted February 5, 2015 This support request is being escalated to our root admin.
Krydos Posted February 6, 2015 Posted February 6, 2015 It looks like Net_GeoIP http://pear.php.net/manual/en/package.networking.net-geoip.php does the same thing and is already installed on both servers. Why not just use that?
To175 Posted February 8, 2015 Author Posted February 8, 2015 Ho thanks a lot sorry :)/&--#62;But in the code there is : require_once "Net/GeoIP.php";I don't have this file, I can't find it, if I delete this line, it sais : Fatal error: Class 'Net_GeoIP' not found in /home1/thio175/public_html/test.php on line 4$geoip = Net_GeoIP::getInstance("/path/to/geoipdb.dat");Ftp manager can't find the file too in ftp.
Krydos Posted February 9, 2015 Posted February 9, 2015 Hi, I need to have the country of the IP !Because In minecraft my plugin have to get the country from my url !But in the code there is :require_once "Net/GeoIP.php" I don't have this file, I can't find it,Ok, I tested this out for you. Here is my test site: http://krydos.tk/country/ To create this site I first went to http://stevie.heliohost.org:2082/frontend/x3/module_installers/index.html?lang=php-pear to install the Net_GeoIP package. Once it is installed you will be able to find the files at /home1/thio175/php/Net/ I then copied them to the public_html/country folder to simplify my code, but I'm sure they would work fine where they were. Then I created my index.php file with the following contents: <?php require_once "Net/GeoIP.php"; $geoip = Net_GeoIP::getInstance("GeoIP.dat"); echo $geoip->lookupCountryName($_SERVER['REMOTE_ADDR']); The GeoIP.dat file I got for free from maxmind's website which is linked from the documentation of Net_GeoIP, but you can download it from my website if it's easier for you. http://krydos.tk/country/GeoIP.dat and just put that file somewhere on your account where your php script can access it. 1
Recommended Posts