Question
How to install GeoIP php extension for PHP 7.0 and PHP 7.1 supplied by Plesk?
Answer
- Connect to the server via SSH.
- Install required libraries and packages:
For RHEL/CentOS and PHP 7.0:# yum install make plesk-php70-devel gcc glibc-devel GeoIP-devel zlib-devel
For RHEL/CentOS and PHP 7.1:
# yum install make plesk-php71-devel gcc glibc-devel GeoIP-devel zlib-devel
For Debian/Ubuntu and PHP 7.0:
# apt-get install plesk-php70-dev build-essential
# apt-get install libgeoip-dev geoip-bin geoip-databaseFor Debian/Ubuntu and PHP 7.1:
# apt-get install plesk-php71-dev build-essential
# apt-get install libgeoip-dev geoip-bin geoip-database - Install GeoIP v. 111 with PHP7 support:
For PHP 7.0:# /opt/plesk/php/7.0/bin/pecl install http://pecl.php.net/get/geoip-1.1.1.tgz
For PHP 7.1:
# /opt/plesk/php/7.1/bin/pecl install http://pecl.php.net/get/geoip-1.1.1.tgz
- Add "
to the PHP's configuration (
extension=geoip.so"
php.ini
) file:
For PHP 7.0 modify file/opt/plesk/php/7.0/etc/php.ini
For PHP 7.1 modify file/opt/plesk/php/7.1/etc/php.ini
- Check the installation:
For PHP 7.0:# /opt/plesk/php/7.0/bin/php -m | grep geoip
For PHP 7.1:
# /opt/plesk/php/7.1/bin/php -m | grep geoip
Note: for PHP versions other that 7.0 and 7.2, specify corresponding version in each step. For example:
# apt-get install plesk-php72-dev build-essential
# /opt/plesk/php/7.2/bin/php -m | grep geoip