xiaoyunet 发表于 2017-5-18 22:10:43

求php geoip扩展

求php geoip扩展

xiaoyunet 发表于 2017-5-18 22:16:51

PHP的扩展插件该增加了!!!手动安装死活安不上。 求帮助!! 求面板支持

xiaoyunet 发表于 2017-5-18 22:28:08

安装GEOIP# yum install GeoIP GeoIP-deve
##下载GeoIP的数据库,有精确到国家和地区包括IPv6 自行选择...###
# wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
##解压下载的库.###
# gzip -d GeoLiteCity.dat.gz
##移动到目录.###
# mv GeoLiteCity.dat /www/server/geoip/GeoIPCity.dat

##下载GeoIP PECL扩展##
# wget -c http://pecl.php.net/get/geoip-1.1.1.tgz
# tar -zxvf geoip-1.1.1.tgz
# cd /www/server/geoip
# /www/server/php/55/bin/phpize
# ./configure --with-php-config=/www/server/php/55/bin/php-config --with-geoip

##操作到此##

# make
##make: *** No targets specified and no makefile found.Stop.##
## 这里make提示错误。进行到此处。看如何解决##
# make install

在 php.ini 里加上
extension=geoip.so
接着重启一下 php 就行了
现在,你可以使用 php 手册里的 GeoIP 部份函数了
http://cn.php.net/manual/en/book.geoip.php


上面是我的操作步骤
页: [1]
查看完整版本: 求php geoip扩展