How to create custom php.ini?

In order to modify the PHP parameters for a single domain, we can use custom php.ini file. Given below are the steps used to create custom php.ini.

1. Copy php.ini to public_html directory and make the required modifications(if any).

===
cp -a /usr/local/lib/php.ini /home/test/public_html/php.ini
===

Where test is the cpanel user for which we are going to make custom modifications.

2. Add the following line in .htaccess file.

———————————————————————
suPHP_ConfigPath /home/test/public_html/
———————————————————————

Now, all the sub folders will use this custom php.ini. This will ensure that PHP settings are propagated to child folders. Otherwise, php setting won’t be propagated to child folders.

NOTE:: Custom php.ini will be used only in suPHP enabled servers.

Advertisements
  1. Leave a comment

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: