Author Topic: How to install the GeoIP Geo location PECL extension?  (Read 19826 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
How to install the GeoIP Geo location PECL extension?
« on: November 10, 2015, 01:54:00 AM »
I tried install the GeoIP Geo location PECL extension on centos 6 but no luck.

#yum install geoip geoip-devel php-pear

#pecl install geoip

Added "extension=geoip.so" to the php.ini and restart apache.

Everything installed very well and when I tired to check with "php -m | grep -i geo" command I got the following error:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/extensions/no-debug-non-zts-20100525/geoip.so' - /usr/lib64/extensions/no-debug-non-zts-20100525/geoip.so: cannot open shared object file: No such file or directory in Unknown on line 0

Can somebody tell me whats (why is geoip.so missing) wrong or how can I install the GeoIP Geo location PECL extension?

Offline
**
Re: How to install the GeoIP Geo location PECL extension?
« Reply #1 on: November 10, 2015, 03:25:23 AM »
First of all you have to be sure that latest pear with pecl extension is installed into your server.

After that to install geoip extension properly follow the below guide :

1. First of all edit your php.ini file and remove the "extension=geoip.so" line and "extension_dir=/usr/lib64/extensions/no-debug-non-zts-20100525" lines which may have come from your previous installation.
2. Run the below commands :
Code: [Select]
yum -y install geoip-devel
cd /tmp
wget http://pecl.php.net/get/geoip-1.0.8.tgz
tar -zxvf  geoip-1.0.8.tgz
cd geoip-1.0.8
/usr/local/bin/phpize
./configure --with-php-config=/usr/local/bin/php-config
make
make install
3. After "make install" command execution done you will get a line stating the shared extension directory path. For Example : some text /usr/lib64/extensions/no-debug-non-zts-20131226
4. Copy that directory path only. Then go to your php.ini file editor.
5. Go to the bottom of the file and paste : extension_dir = the path you copied from the make install completion.
6. After the extension_dir line put : extension=geoip.so
7. Restart Apache and to verify the module, use this command : php -m

Hope the tutorial helps you. Thanks...
« Last Edit: November 10, 2015, 03:28:22 AM by Farukh Khan »

Offline
*
Re: How to install the GeoIP Geo location PECL extension?
« Reply #2 on: November 15, 2015, 05:57:12 AM »
You are SUPERSTAR! Thank you! :) Work for me...

Offline
**
Re: How to install the GeoIP Geo location PECL extension?
« Reply #3 on: November 15, 2015, 12:08:20 PM »
Glad to help :)

Offline
***
Re: How to install the GeoIP Geo location PECL extension?
« Reply #4 on: November 16, 2016, 06:41:26 AM »
Thank you! it works now

Offline
*
Re: How to install the GeoIP Geo location PECL extension?
« Reply #5 on: March 06, 2019, 06:45:53 AM »
Please help me. I try follow all steps in this guide, but my apache was still not restart or not running :((.
I try 5 times and all result is same. My cwp is down now :(