• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved How do I install the GeoIP

It shoud be something like that:

yum install make plesk-php56-devel gcc php-pear php-devel httpd-devel GeoIP GeoIP-devel
/opt/plesk/php/5.6/bin/pecl install geoip
echo "extension=geoip.so" > /opt/plesk/php/5.6/etc/php.d/geoip.ini
plesk bin php_handler --reread
 
It shoud be something like that:

yum install make plesk-php56-devel gcc php-pear php-devel httpd-devel GeoIP GeoIP-devel
/opt/plesk/php/5.6/bin/pecl install geoip
echo "extension=geoip.so" > /opt/plesk/php/5.6/etc/php.d/geoip.ini
plesk bin php_handler --reread

I use Ubuntu 14.4 and PHP7 unless i will downgrade to 5.6
 
It shoud be something like that:

yum install make plesk-php56-devel gcc php-pear php-devel httpd-devel GeoIP GeoIP-devel
/opt/plesk/php/5.6/bin/pecl install geoip
echo "extension=geoip.so" > /opt/plesk/php/5.6/etc/php.d/geoip.ini
plesk bin php_handler --reread

kinda need this for ubuntu please
 
Hi !
I've followed this thread to install GEOIP to my Plesk (17.0.17 on Debian 8) and it went well : I can see geoip enabled on Plesk's PHP setting.
But when I'm trying to run php function like
<?php print_r(geoip_record_by_name('php.net')); ?>

There's no output.

Any idea where the issue come from ?

Thanks
 
Is that when you run
<?php phpinfo() ?>
?
I've already run

<?php phpinfo(); ?>

and I can see GEOIP extension on the details.

Through plesk dashboard, on php setting, I can see too that the geoip checkbox is checked.

But when I run

<?php print_r(geoip_record_by_name('php.net')); ?>

The page remains empty
 
Any information on it in the server''s error_log?
Yeah ! I was looking the wrong log so I didn't see this message ""NOTICE: PHP message: PHP Warning: geoip_record_by_name(): Required database not available at /usr/share/GeoIP/GeoIPCity.dat"
So I've downloaded the GeoIP database and renamed it after the message and now its working !

Thanks !
 
Last edited:
I installed geoIP via How to Install Mod_GeoIP for Apache in RHEL and CentOS


yum install mod_geoip GeoIP GeoIP-devel GeoIP-data zlib-devel

but I getting this error when trying to compile for php 7.2

/opt/plesk/php/7.2/bin/pecl install geoip

...

running: make
/bin/sh /tmp/pear-build-rootiRndJ7/geoip-1.0.8/libtool --mode=compile cc -I. -I/tmp/geoip -DPHP_ATOM_INC -I/tmp/pear-build-rootiRndJ7/geoip-1.0.8/include -I/tmp/pear-build-rootiRndJ7/geoip-1.0.8/main -I/tmp/geoip -I/opt/plesk/php/7.2/include/php -I/opt/plesk/php/7.2/include/php/main -I/opt/plesk/php/7.2/include/php/TSRM -I/opt/plesk/php/7.2/include/php/Zend -I/opt/plesk/php/7.2/include/php/ext -I/opt/plesk/php/7.2/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/geoip/geoip.c -o geoip.lo
libtool: compile: cc -I. -I/tmp/geoip -DPHP_ATOM_INC -I/tmp/pear-build-rootiRndJ7/geoip-1.0.8/include -I/tmp/pear-build-rootiRndJ7/geoip-1.0.8/main -I/tmp/geoip -I/opt/plesk/php/7.2/include/php -I/opt/plesk/php/7.2/include/php/main -I/opt/plesk/php/7.2/include/php/TSRM -I/opt/plesk/php/7.2/include/php/Zend -I/opt/plesk/php/7.2/include/php/ext -I/opt/plesk/php/7.2/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/geoip/geoip.c -fPIC -DPIC -o .libs/geoip.o
/tmp/geoip/geoip.c: In function 'zif_geoip_db_filename':
/tmp/geoip/geoip.c:220:44: error: macro "RETURN_STRING" passed 2 arguments, but takes just 1
RETURN_STRING(GeoIPDBFileName[edition], 1);
^
/tmp/geoip/geoip.c:220:3: error: 'RETURN_STRING' undeclared (first use in this function)
RETURN_STRING(GeoIPDBFileName[edition], 1);
^
/tmp/geoip/geoip.c:220:3: note: each undeclared identifier is reported only once for each function it appears in
/tmp/geoip/geoip.c: In function 'zif_geoip_db_get_all_info':
/tmp/geoip/geoip.c:240:73: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
add_assoc_string(row, "description", (char *)GeoIPDBDescription, 1);
....
 
Last edited:
Back
Top