Set Up a PHP .user.ini File in cPanel

Last modified: August 1, 2020
You are here:
Estimated reading time: 1 min

The PHP .user.ini file allows you to customize PHP directives. To set up a PHP .user.ini file we must use a PHP version 5.3.0 or higher.

Perform the following steps to set up a user.ini file:

1) Log in to cPanel.

2) Navigate to the File Manager (Home >> Files >> File Manager) interface.

php-user-ini

 

3) Make sure that you are in public_html directory and hidden file visible.

php-user-ini

 

4) Click the option ‘File’ to create the new File.

php-user-ini

 

5) In the Create a New Field text box, enter .user.ini and click Create New File.

6) If you want to edit the.user.ini file click the file and edit.

 

The common changes that are altered when making custom PHP changes are:

1) memory_limit: If you want to setup PHP memory limit open the.user.ini file and add the line

memory_limit = 128M

The recommended size is 128 mb.

2) upload_max_filesize: Open.user.ini file and add

upload_max_filesize = 1000M

The default size is 128MB on our shared/reseller/managed VPS but this can be increased as high as 2GB (max).

3) post_max_size: Open.user.ini file and add

post_max_size=1005M

The default size is 128MB on our shared/reseller/managed VPS but this can be increased as high as 2GB (max). Set the “post_max_size” value higher than the “upload_max_filesize” value.

4) max_execution_time: Open .user.ini file and add

max_execution_time=120

This can be set to whatever time limit you wish, but keep in mind that the server is configured to kill off PHP connections that last longer than 30 minutes.

5) max_input_time: Open .user.ini file and add

max_input_time=120

This can be set to whatever time limit you wish just like before. However just like before keep in mind that the server is configured to kill off PHP connections that last longer than 30 minutes.

If you set .user.ini within public_html, the changes are applied to the software that is installed in that particular folder only. Separate .user.ini is necessary for each directory.

 

If you need any further assistance please reach our support department.

Was this article helpful?
Dislike 0
Views: 13