qq_18691129 于 2016.02.22 17:31 提问
- centos6.5 安装GeoIP PECL扩展 2C
How do I install the GeoIP Geo location PECL extension?
If you’re using Ubuntu or Debian run the following command:
sudo apt-get install php5-geoip php5-dev libgeoip-dev
If you have to build the extension by hand, first make sure you have the following installed:
PEAR/PECL (which includes the pecl executable)
The GeoIP C library with development files
Build tools (including GCC, make, etc.)
php development files
Then run the following command:
sudo pecl install geoip
Finally, add the following to your php.ini file:
Once the PECL extension is installed, you must configure it. Add the following to your php.ini file:
Replace /path/to/piwik with the path to your Piwik installation.
And finally, if you are using the GeoLite City database there is one more thing you need to do. The PECL extension won’t recognize the database if it’s named GeoLiteCity.dat so make sure it is named GeoIPCity.dat.
Restart the webserver and the GeoIP extension should now be loaded and working in Piwik > Settings > Geolocation.