Tuesday, September 6, 2016

Custom PHP in CGI

For creating custom php.ini you will need to create a file called php5.cgi
under the public_html directory of the user. The php5.cgi must contain the
following code in it.

#############
#!/bin/sh
exec /usr/local/cpanel/cgi-sys/php5 -c /home/username/public_html/php.ini
#############

The php4.cgi must have execute permissions and correct ownership.

chmod 755 /home/username/public_html/php5.cgi

chown username.username /home/username/public_html/php5.cgi

Once this is done, create a .htaccess in the directory you need custom
php4 and add the following code in it.

###########
AddHandler application/x-httpd-php .php
Action application/x-httpd-php /php5.cgi
###########

Once the is done, you can create a custom php.ini in public_html.

Thats all!!

No comments:

Post a Comment