ip2region_private/binding/php5_ext
PHP Static 5ea194bb22 fix php5 symbol duplicate 2020-03-22 11:43:46 +08:00
..
lib Optimize the installation DOC and rename the php ext binding name 2020-02-21 13:56:26 +08:00
tests Optimize the installation DOC and rename the php ext binding name 2020-02-21 13:56:26 +08:00
.gitignore Optimize the installation DOC and rename the php ext binding name 2020-02-21 13:56:26 +08:00
CREDITS Optimize the installation DOC and rename the php ext binding name 2020-02-21 13:56:26 +08:00
README.md Optimize the installation DOC and rename the php ext binding name 2020-02-21 13:56:26 +08:00
config.m4 Optimize the installation DOC and rename the php ext binding name 2020-02-21 13:56:26 +08:00
config.w32 Optimize the installation DOC and rename the php ext binding name 2020-02-21 13:56:26 +08:00
ip2region.c fix php5 symbol duplicate 2020-03-22 11:43:46 +08:00
ip2region.php Optimize the installation DOC and rename the php ext binding name 2020-02-21 13:56:26 +08:00
php_ip2region.h fix memory leak and symbol duplicate 2020-03-22 11:38:21 +08:00

README.md

ip2region client - PHP扩展(php5版本)

安装步骤

  • git clone https://github.com/lionsoul2014/ip2region.git

  • cd ip2region

  • cp binding/php5_ext 到 php source code 的 ext/ip2region 目录下

  • cp binding/c/ 里面所有的文件到 php source code 的 ext/ip2region/lib 目录下

  • 在 ext/ip2region 下,运行

      phpize
      ./configure
      make && sudo make install
    
  • 配置 ip2region.ini 指定 db_file 路径,(cli/fpm)

      extension=ip2region.so
      ip2region.db_file=/path/to/ip2region.db
    

默认 ip2region.db 在项目根目录下的 data 文件夹下,如有改动,请修改 ip2region.ini 的 db_file

  • 测试

在 ext/ip2region/ 下运行

    php ip2region.php

使用

参考当前目录下的 ip2region.php