In running website applications that require PHP, you will need a php.ini file. This is the default configuration used to control variables such as file timeouts, resource limits, and upload sizes.
Note: There are standard PHP settings already set in the server, which your site uses by default. If you do not need to make any modifications to one or more of these settings, you do not need to create or change a php.ini file.
Below is a sample php.ini configuration:
By default, the php.ini file is located at public_html/php.ini. If you do not see a file named php.ini in your public_html folder, you may create one using the following steps:
- Click Sign Up / Log In at the top of this page.
- Select Hosting Manager from the drop-down menu.
- Enter your username and password and click Log In.
- On the Home page, click the Files icon or the [ v ] arrow symbol on the right side, then click the File Manager button.
- Open your Web Root and ensure that the Show Hidden Files option is ticked.
- Navigate to the file that contains your scripts (if you wish to apply rules to all scripts stay in public_html) and click New File in the top menu.
- Enter the file name php.ini and click Create New File.
- Right-click on the file that you just created and click Edit.
- Click Edit again in the dialog box.
- Make the desired changes and click Save Changes.
Congratulations, you have just created a php.ini file.
It is important to note that the php.ini file only works for scripts that are in the same folder as the php.ini file. If you want to load it recursively in all of your subfolders, add the following line of code to your .htaccess file in the folder where you want to apply it (replace "username" with your cPanel username and assuming that your php.ini file is in public_html):
- SuPHP_ConfigPath /home/username/public_html/php.ini