Adding custom php.ini for php5

php5 doesn’t check for custom php.ini files like php4 does. To hack this, there is simply method

1)Create a script php5-cgi in /home/username/public_html/cgi-bin with permission 755 and owership username. Add the entries

” #!/bin/sh

exec /usr/local/cpanel/cgi-sys/php5 -c /home/username/public_html/php.ini ”

2)Create a .htaccess in the directory you need custom php5 configuration working with the following code in it.

Options All -Indexes

AddHandler php5 .php

Action php5 /cgi-bin/php5.cgi

3) Copy the php.ini file that is currently used( php -i | grep php.ini ) to /home/username/public_html and change according to your needs.

If any error occurs , please check ScriptAlias is set for cgi-bin folder or try changing the Handler name or ad

Advertisements
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: