Modifying the htaccess file to use a custom php.ini file throughout your website

This guide provides instructions for modifying .htaccess to use a custom php.ini throughout your cPanel site.

1. Log in to cPanel, if you haven’t already done so
2. Create a custom php.ini, if you haven't already done so.
3. Locate the absolute path of your cPanel Home Directory and make a note of it.
4. Open File Manager

5. Select the .htaccess file by clicking on it once and then click Code Editor

php guide

6. Ensure you have the correct file selected and then click Edit

php guide

7. Enter the following code, replacing homedirectory with the Home Directory you found in step 3:

<IfModule mod_suphp.c>
suPHP_ConfigPath /homedirectory/public_html/php.ini

8. Once you have finished editing your .htaccess file, click Save Changes from the top right of the editing window.

php guide

  • Email, SSL
  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

How to Log in to cPanel?

You need to log in to cPanel  in order to manage your web site.To access cPanel using your...

How to Backup and Restore Emails in Horde?

In this tutorial, we can check how to backup and restore emails in Horde. In cPanel, it is...

How to create custom error pages?

Login into cPanel using provided URL and its credentials Go to Advanced section Click on...

Enabling PhpmyAdmin for cPanel

How to Enable Phpmyadmin? 1. Login to your WHM > Feature Manager 2. You can see "Add a new...

Increasing Max Upload Size in cPanel

Hello, How to increase Max upload size in cPanel using php.ini file ? Login to your cPanel >...