Change php directives with suPHP

You need to create 2 files in public_html of website where suPHP is enabled. A .htaccess specifying path to php.ini configuration and a php.ini with directives.
You can change php settings and load extensions from a central php.ini for all site folders.


Example for account “account-name”. Make sure you update that in .htaccess content:


suPHP_ConfigPath /home/[account-name]/public_html



register_globals = Off

Install GeoIP PHP Extension

Install GeoIP C API
Change 1.4.8 to downloaded version.

cd /usr/local/src
tar zxvf GeoIP.tar.gz
cd GeoIP-*
make check
make install

Install PHP PECL extension

pecl install geoip

Find php.ini

php -i | grep php.ini

Enable extension to load in php.ini:

; Dynamic Extensions ;

You may need to restart HTTP server (apache) to apply changes.

Download Geo Lite City database

cd /usr/local/src
wget -N -q
gunzip GeoLiteCity.dat.gz
mv GeoLiteCity.dat /usr/local/share/GeoIP/GeoIPCity.dat

For more accurate detection and production projects, buy the full GeoCity database from MaxMind.