How to Create Custom PHP.INI in cPanel?

Creating a custom php.ini file can be useful in certain circumstances such as allowing different functions on different accounts, or memory limits, etc.

Note: Make sure to replace USERNAME with the account’s username.

Firstly, run this in SSH:
cp /usr/local/lib/php.ini /home/USERNAME/public_html

Next, run this in SSH (make sure you’re in public_html):
chown USERNAME:USERNAME php.ini

Finally, edit the .htaccess file in public_html and add this line:
SetEnv PHPRC /home/USERNAME/public_html/php.ini

Leave a Reply

Your email address will not be published. Required fields are marked *