Installing GeoIP for PHP on CentOS 5 Server
After a few hours battling with this I finally managed to get this to work.
Firstly, you need to install the EPEL repository files.
sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/5Server/i386/epel-release-5-4.noarch.rpmIt’s worth, at this point if the above command doesn’t work, looking at http://dl.fedoraproject.org/pub/epel/ and finding your CentOS distro and navigating through to find the correct package url. Then you can replace the url in the above statement.
Once that is done you can perform the actual GeoIP library:
sudo yum install geoip-devel
Finally,
sudo pecl install geoip
to install the PHP PECL extension.
Now all you need to to is add extension=geoip.so to your php.ini