Centos 安装GeoIp 库

centos install geoip


sudo pear update-channels

#######

sudo yum install re2c GeoIP GeoIP-data GeoIP-devel
sudo pecl install geoip

vi /etc/php.d/geoip.ini

I also added the following settings in /etc/php.d/geoip.ini:

extension=geoip.so
geoip.custom_directory = /usr/local/share/GeoIP/

重启 php.
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
gunzip GeoIP.dat.gz
mv GeoIP.dat /usr/local/share/GeoIP/
1,/var/lib
2,/var/share/
3,/usr/local/share

你可能感兴趣的:(centos)