How to install PHP Pecl GeoIP on Linux

If you are a webmaster and want to include php GeoIP functions in your code. Then you have to install Pecl GeoIP extension on your server. After installing this extension you can get geo data of any IP-address using geoip_record_by_name function. To install this extention follow these steps

For Debian/Ubuntu
Run following command as root user
apt-get install libgeoip-dev php5-dev php5-pear
pecl install geoip
then simply add extension=geoip.so in php.ini using nano or vi command
For Redhat/Centos
Run following command as root user
yum install  GeoIP-devel
pecl install geoip
then simply add extension=geoip.so in php.ini using nano or vi command

No comments:

Post a Comment