In order to be able to use the geoip function geoip_time_zone_by_country_and_region I had to upgradethe default debian lenny version of php5-geoip (1.0.3-1) to the latest 1.0.7 aviable as a pecl package.
In order to upgrade to the newer php-geoip 1.0.7 I had to first remove the old php5-geoip version installed through debian package manager.
debian-server:~# dpkg -r --purge php5-geoip
Notice that if you don’t do a apache restart after removing the php5-geoip, if your php scripts has something that deals with php geoip then your Apache server is gonna fail until restarted, therefore to omit the failed Apache issues and possible downtimes issue a apache restart before continuing.
debian-server:~# /etc/init.d/apache2 restart
Then I tried installing the newer php5 geoip using pecl
thus I issued:
debian-server:~# pecl install geoip
…. But guess what the built failed with an error:
checking for geoip files in default path… not found
To deal with the php geoip compile issue I had to install:
libgeoip-dev – Development files for the GeoIP library
debian-server:~# apt-get install libgeoip-dev
Then again I installed using the pecl interface pecl php pcakage install interface.
debian-server:~# pecl install geoip
Thereafter I had to also include extension=geoip.so in php.ini
debian-server:~# echo "extension=geoip.so" >> /etc/php5/apache2/php.ini
Needless to say for the new geoip module to take effect you need to restart your Apache webserver.
debian-server:~# /etc/init.d/apache2 restart
Now this will enable the unexisting geoip_time_zone_by_country_and_region function in the earlier releases than 1.0.4 of php geoip.
So your geoip_time_zone_by_country_and_region should be ready to use from your php scripts from now on.
More helpful Articles
Tags: Upgrading to latest GeoIP PHP module on Debian Lenny 5 (Install latest GeoIP from pear)
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.2 (KHTML, like Gecko) Chrome/4.0.221.7 Safari/532.2
I’m honored to obtain a call from a friend as he identified the crucial guidelines shared on your internet site. Browsing your blog post is actually a real exceptional experience. Several thanks for taking into consideration readers at all like me, and I wish you the most effective of achievements as being a expert domain.
View CommentView CommentMozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)
Fantastic blog you have here but I was wondering if you knew of any community forums that cover the same topics discussed in this article? I’d really like to be a part of online community where I can get feed-back from other experienced individuals that share the same interest. If you have any suggestions, please let me know. Kudos!
View CommentView Comment