How to install GeoIP php extension for PHP 7.0 and PHP 7.1 supplied by Plesk?

Comments

1 comment

  • Avatar
    John Hayden (Edited )

    UPDATE:
    It appears that PHP 8.x is not yet supported (https://pecl.php.net/package/geoip/1.1.1/windows)

    The only current option is to use the GeoIP2 library (https://github.com/maxmind/GeoIP2-php)


    ORIGINAL REPLY:

    This does not work as-is. Yes, I'm trying to add it to PHP 8.0-8.3 and not 7.x like the instructions states, but the geoIP extension should be compatible.

    The command:
    /opt/plesk/php/8.3/bin/pecl install http://pecl.php.net/get/geoip-1.1.1.tgz

    Errors out with:
    /tmp/geoip/geoip.c: In function 'zif_geoip_db_avail':
    /tmp/geoip/geoip.c:264:51: error: expected ')' before 'TSRMLS_CC'
    and about 100 more errors after that.

    The error happens with both Plesk GUI > Tools & Settings > PHP Settings > FPM > Manage PECL Extension and via SSH with the command above.

    I suspect that ./configure command is not able to find the proper plesk-php8x-dev file (/opt/plesk/php/8.x/bin/php-config), or that that file is using the default PHP config and not the dev package version. Haven't figured out a proper solution yet. I'll update this if I do. If you know of a solution, please share!

    0

Please sign in to leave a comment.

Have more questions? Submit a request