CentOS / Ubuntu 安装 IP2Location C Library 8.0.8

IP2Location C Library

1、下载并解压

wget -O IP2Location-C-Library-8.0.8.tar.gz https://codeload.github.com/chrislim2888/IP2Location-C-Library/tar.gz/8.0.8
tar -zxf IP2Location-C-Library-8.0.8.tar.gz
cd IP2Location-C-Library-8.0.8

备用下载地址:https://down.24kplus.com/linux/IP2Location-C-Library-8.0.8.tar.gz

2、编译安装

autoreconf -i -v --force
./configure --prefix=/usr
make
make install
cd data
perl ip-country.pl

如果出现错误

configure.ac:42: error: possibly undefined macro: AC_PROG_LIBTOOL
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.

执行:

yum install libtool libsysfs

3、测试(可选)

cd test
./test-IP2Location

IP2Location API version: 8.0.8 (80008)
IP2Location IPv4 Testing passed.
IP2Location IPv6 Testing passed.