You can use a .user.ini file with your PHP application to configure PHP settings such as the amount of data that can be uploaded, displaying verbose errors, increasing memory limits, and many other configurations. A .user.ini file needs to be in the root of the application or website with the settings configured you wish to change.

If a file does not exist, the default values are set from the server.


Creating the file

  1. Create a .user.ini file named exactly as shown including the first period.
  2. Add the settings you want to change to the file using the same syntax as a standard php.ini file. Some examples are shown below, but a full list is available here.
  3. Upload it to the root of your application or website. (This is commonly the public_html directory, but may be different if you're using a subdomain.)

Examples


PHP Error Debugging

; Example Settings
error_reporting = E_ALL & ~E_DEPRECATED
display_errors = On
display_startup_errors = On

Memory Limit

This sets the maximum amount of memory in bytes that a script is allowed to allocate. 

memory_limit = 256M


Max Upload Size

The maximum size of an uploaded file, this may required if you want to upload larger images or attachments.

upload_max_filesize = 50M


Max Execution Time

This sets the maximum time in seconds a script is allowed to run before it is terminated by the parser (Note: there is a hard limit of 300 seconds imposed by our load balancing layer, do not set above 300).

max_execution_time=120


Max Input Time

This sets the maximum time in seconds a script is allowed to parse input data, like POST and GET.

max_input_time=120


Max Post Size

Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize.

post_max_size=1024M

Full Example

This just an example of what a full .user.ini file with a handful of changes may look like, for completeness.

max_execution_time=120
upload_max_filesize=200M
post_max_size=200M
memory_limit=256M