使用GeoIP获取IP地址对应的信息(安装)
来源:互联网 发布:化学外文文献数据库 编辑:程序博客网 时间:2024/06/16 01:07
GeoIP是MaxMind公司推出的一款可以查询IP地址对应详细信息的工具(包括国家城市邮编等,邮编中国的不一定有),其实是一个.mmdb .CSV的数据库文件,有免费版和付费版,信息精度不一样,网上还有一种简单的.dat文件的方法,但是只能查英文(看文件大小就知道少),所以想要很好的使用这个工具还是正儿八经的用composer安装吧。
URL:http://maxmind.github.io/GeoIP2-php/
另外提一句,.dat文件的那个弄好了之后可以做为php扩展使用,直接调用相关的函数即可。
先安装composer(不多提了),然后官方用的是这条命令:
php composer.phar require geoip2/geoip2:~2.0
//composer嘛,凡事先更新$ sudo composer self-update[sudo] password for tianyi: Updating to version 1.4.1 (stable channel). Downloading: 100% Use composer self-update --rollback to return to version 1.3.2//请忽略目录,composer设置全局了之后哪里都能用$ composer requireYou are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebugSearch for a package: geoip2 //这里输入geoip2Found 15 packages matching geoip2 [0] geoip2/geoip2 [1] bonvga/geoip2 [2] gpslab/geoip2 [3] tobai/magento2-geo-ip2 [4] overals/yii2-geoip2 [5] bobey/geoip2-geolite2-composer [6] acidreign/laravel-geoip2 [7] phirational/laravel-geoip2 [8] marketo/silverstripe-regional-maxmind-geoip2 [9] maxmind-db/reader [10] cravler/maxmind-geoip-bundle [11] mi-la01/kt_maxmind_geoip [12] lysenkobv/yii2-geoip [13] whitworf/geoip2-bundle [14] faustbrian/laravel-geoip2//选第一个,当然这两条命令你也可以一起打Enter package # to add, or the complete package name if it is not listed: 0//选2.0版本或别的,注意,不填版本号直接enter的可能会卡在那没反应Enter the version constraint to require (or leave blank to use the latest version): ~2.0Search for a package: ./composer.json has been updatedLoading composer repositories with package informationUpdating dependencies (including require-dev)Package operations: 4 installs, 0 updates, 0 removals - Installing composer/ca-bundle (1.0.7): Downloading (100%) - Installing maxmind/web-service-common (v0.3.1): Downloading (100%) - Installing maxmind-db/reader (v1.1.3): Downloading (100%) - Installing geoip2/geoip2 (v2.4.5): Downloading (100%) composer/ca-bundle suggests installing symfony/process (This is necessary to reliably check whether openssl_x509_parse is vulnerable on older php versions, but can be ignored on PHP 5.5.6+)maxmind-db/reader suggests installing ext-maxminddb (A C-based database decoder that provides significantly faster lookups)Writing lock fileGenerating autoload files//安装完成
0 0
- 使用GeoIP获取IP地址对应的信息(安装)
- 使用GeoIP获得IP地址的地理地址信息
- GeoIP为ip地址的相关信息提供了解决方案
- ip地址查询(GeoIP)
- MaxMind GeoIP --- 通过IP地址获取地理信息
- 如何获取域名(网址)对应的IP地址
- 如何获取域名(网址)对应的IP地址
- 批量获取主机名对应的ip地址
- 获取域名对应的IP地址
- 通过地址获取对应的源代码信息
- win7 xp vista 下获取进程对应的ip地址和端口信息
- 转发:AWStats上的IP=>城市信息解析包安装 GeoIP City Lite
- python3中使用GeoIP来查找IP信息
- 根据IP地址获取对应的MAC地址
- php获取ip地址以及ip对应的省市区
- 获取ip地址信息
- 笔记(referer,获取Ip的地址信息,nginx配置)
- 获取客户端的IP地址等信息
- 从零开始,5分钟创建并玩转属于自己的区块链(图文攻略)
- 如何快速转载CSDN中的博客
- 浅谈如何实现table所有td(可跨行跨列)的值存进二维数组
- JVM入门----概述
- 高通安卓调试LCD几方面总结(一)
- 使用GeoIP获取IP地址对应的信息(安装)
- openlayers4加载Esri和GeoServer的各类服务图层
- 从最简单的HelloWorld理解MVP模式
- idea下的spring boot remote debug 启动办法
- Spring学习心得(19)-- 一个目标类对应多个切面的例子
- spark入门实例 wordCount
- Form表单测试案例-获取token值;jmeter关联
- 打造Android不死进程
- 二分查找法