ABHIONLINUX
Site useful for linux administration and web hosting

2009/12/22

Getting custom php.ini working on php-cgi

1, Copy the servers default php.ini to your home directory

2, Make the following directory in user home directoy and chown to user:user
cgi-bin

3, Create a file php.cgi in cgi-bin with the following content
#!/bin/sh
exec /usr/local/cpanel/cgi-sys/php5 -c /home/user/public_html/

4, Chmod +x php.cgi and chown the file to user:user.

5, Add the following in the .htaccess.

Action application/x-httpd-php5 /cgi-bin/php.cgi

Installing a custom module in cpanel server

To install a custom module:

1. Download and unzip it into /var/cpanel/easy/apache/custom_opt_mods/.
2. When logged into your server as root, you can install any module listed below by running the following commands. Be sure to replace $NAME.tar.gz with the filename of the module you wish to download:

wget http://easyapache.cpanel.net/optmods/$NAME.tar.gz
tar -C /var/cpanel/easy/apache/custom_opt_mods -xzf $NAME.tar.gz

For example:
If you want to install mod_python

cd /var/cpanel/easy/apache/custom_opt_mods

wget http://twiki.cpanel.net/twiki/pub/EasyApache3/CustomMods/custom_opt_mod-mod_python.tar.gz
tar -C /var/cpanel/easy/apache/custom_opt_mods -xzf custom_opt_mod-mod_python.tar.gz

Reference : http://docs.cpanel.net/twiki/bin/view/EasyApache3/CustomMods