CentOS 6.5 下安装php-geoip扩展

环境:CentOS 6.5 64bit

PHP版本:5.3.3


1.安装GeoIP

[root@localhost ~]# yum install GeoIP GeoIP-devel GeoIP-data
但是安装失败:

[root@localhost ~]# yum install GeoIP GeoIP-devel GeoIP-data
Loaded plugins: auto-update-debuginfo, fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
No package GeoIP available.
No package GeoIP-devel available.
No package GeoIP-data available.
Error: Nothing to do
解决方法参考: https://serverfault.com/questions/372978/installing-geoip-on-centos
安装epel,执行以下命令:

[root@localhost ~]# yum install epel-release


之后重新通过yum安装成功:

[root@localhost ~]# yum install GeoIP GeoIP-devel GeoIP-data

[root@localhost ~]# rpm -qi GeoIP
Name        : GeoIP                        Relocations: (not relocatable)
Version     : 1.6.5                             Vendor: Fedora Project
Release     : 1.el6                         Build Date: Tue 14 Apr 2015 03:28:46 PM CST
Install Date: Tue 23 Jan 2018 05:06:19 PM CST      Build Host: buildvm-09.phx2.fedoraproject.org
Group       : Development/Libraries         Source RPM: GeoIP-1.6.5-1.el6.src.rpm
Size        : 317185                           License: LGPLv2+
Signature   : RSA/8, Tue 14 Apr 2015 11:16:45 PM CST, Key ID 3b49df2a0608b895
Packager    : Fedora Project
URL         : http://www.maxmind.com/app/c
Summary     : Library for country/city/organization to IP address or hostname mapping
Description :
GeoIP is a C library that enables the user to find the country that any IP
address or hostname originates from.

It uses file based databases that can optionally be updated on a weekly basis
by installing the geoipupdate-cron (IPv4) and/or geoipupdate-cron6 (IPv6)
packages.
[root@localhost ~]# rpm -ql GeoIP
/usr/bin/geoiplookup
/usr/bin/geoiplookup6
/usr/lib64/libGeoIP.so.1
/usr/lib64/libGeoIP.so.1.6.5
/usr/share/doc/GeoIP-1.6.5
/usr/share/doc/GeoIP-1.6.5/AUTHORS
/usr/share/doc/GeoIP-1.6.5/COPYING
/usr/share/doc/GeoIP-1.6.5/ChangeLog
/usr/share/doc/GeoIP-1.6.5/NEWS.md
/usr/share/doc/GeoIP-1.6.5/README.md
/usr/share/man/man1/geoiplookup.1.gz
/usr/share/man/man1/geoiplookup6.1.gz
[root@localhost ~]# rpm -qi GeoIP-devel
Name        : GeoIP-devel                  Relocations: (not relocatable)
Version     : 1.6.5                             Vendor: Fedora Project
Release     : 1.el6                         Build Date: Tue 14 Apr 2015 03:28:46 PM CST
Install Date: Tue 23 Jan 2018 05:06:24 PM CST      Build Host: buildvm-09.phx2.fedoraproject.org
Group       : Development/Libraries         Source RPM: GeoIP-1.6.5-1.el6.src.rpm
Size        : 23331                            License: LGPLv2+
Signature   : RSA/8, Tue 14 Apr 2015 11:04:29 PM CST, Key ID 3b49df2a0608b895
Packager    : Fedora Project
URL         : http://www.maxmind.com/app/c
Summary     : Development headers and libraries for GeoIP
Description :
Development headers and static libraries for building GeoIP-based applications.
[root@localhost ~]# rpm -ql GeoIP-devel
/usr/include/GeoIP.h
/usr/include/GeoIPCity.h
/usr/lib64/libGeoIP.so
/usr/lib64/pkgconfig/geoip.pc

关于epel的介绍:

http://fedoraproject.org/wiki/EPEL

https://jingyan.baidu.com/article/c843ea0baaf40477931e4a19.html
</

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值