This PECL extension allows you to find the location of an IP address - country, region or state, district, city, latitude and longitude, ZIP/Postal code, time zone, Internet Service Provider (ISP) or company name, domain name, net speed, area code, weather station code, weather station name, mobile country code (MCC), mobile network code (MNC) and carrier brand, elevation, usage type, address type, IAB category and ASN.
To compile it, you will need to have the ip2location c library (version 8.x) installed.
- Download the latest ip2location c libray at https://www.ip2location.com/developers/c
- Decompress the archive.
- Navigate to working directory. example, cd ip2location-c-x.x.x
- autoreconf -i -v --force
- ./configure
- make
- make install
- Decompress the archive.
- Navigate to working directory.
- phpize
- ./configure
- make
- make install
- A successful install will have created ip2location.so and put it into the PHP extensions directory.
- Open the php.ini file, and add an extension=ip2loation.so line.
- Restart apache server. Example, /etc/init.d/apache2 restart
- php -m (You should notice the ip2location module in the list)
For details installation instructions for PHP PECL extensions, please see: http://www.php.net/manual/en/install.pecl.php
- Download free IP2Location LITE databases at https://lite.ip2location.com
- Download IP2Location sample databases at https://www.ip2location.com/developers
- Use the IPv4 BIN file if you just need to query IPv4 addresses.
- Use the IPv6 BIN file if you need to query BOTH IPv4 and IPv6 addresses.
Email: support@ip2location.com.
URL: http://www.ip2location.com