How to set PHP directives using .user.ini
Let’s get started…
What are PHP directives?
PHP directives are the configuration settings used to control various behaviours of PHP functions on your site. This can include for example; the memory limit assigned for PHP, the maximum amount of time before a PHP process will time out and the maximum file-size that could be uploaded via a PHP script.
For sites hosted on LCN Web hosting packages, changes to PHP directives can be applied by uploading a file named .user.ini to the hosting web directory. Changes specified in this file will only apply to the individual site that the file is uploaded to.
How to create a .user.ini file
You can use a text editor like Notepad, Wordpad, or Textedit to create a .user.ini file. You can start with an empty text file, then add each PHP directive that you need to set for your site on a new line and save the file, entering the file name as: .user.ini.
Below are some examples of PHP directives you can add to the .user.ini:
memory_limit=256M post_max_size=1024M upload_max_filesize=1024M max_input_vars=1000 max_input_time=50 max_execution_time=60
How to upload your .user.ini file
After you’ve created a .user.ini file, you can upload it to the webspace for your domain using FTP.
For instructions on how to upload your file via FTP we have guide here
That’s it! You’ve created or edited and uploaded a .user.ini file to your website. The new settings should take effect on your site within five minutes.