View Full Version : Creating Custom php.ini Files for Sites on a cPanel VPS

May 9th, 2012, 12:04 PM
If you have a site on your cPanel VPS that needs a custom php.ini file, you can set that up by following these steps:

Copy /usr/local/lib/php.ini to the site's Web root folder (public_html). Via SSH:

cp /usr/local/lib/php.ini /home/USERNAME/public_html
Make sure the file is owned by their cPanel user via SSH:

Add the following to the site's ".htaccess" file:

SetEnv PHPRC /home/USERNAME/public_html/php.ini

After you follow those steps, the custom php.ini file will take effect throughout the whole site.

NOTE: In the above examples, replace USERNAME with the actual cPanel username.