There was a problem loading the comments.

PHP settings and the .user.ini file

Support Portal  »  Knowledgebase  »  Viewing Article

  Print

Most settings for PHP can be configured via a file called ".user.ini" as defined by the user_ini.filename php.ini setting.  This file is a built-in option for PHP and generally works on any PHP  .  This file can hold php.ini directives, one setting per line. Settings listed as "INI_ANY" or "INI_PERDIR" in the list of settings can be used within this file. 

Using the .user.ini file:

  1. Create a text file with the control panel's file manager and call it ".user.ini"  (ensure the file name begins with a period)
    1. This file can be created with a plain text editor (notepad, text editor, etc but not Word) and uploaded via FTP, however, some systems do not like having the a period as the starting character.
  2. Add the PHP setting to a new line within the file.
    1. See examples below
  3. Save the file to the server within the directory where the PHP script is running at
    1. Normally, this will be your httpdocs, htdocs, or directory named after the domain
  4. Wait about 5 to 10 minutes for PHP to reload the file

Example settings:

  • memory_limit = 256M
  • max_execution_time = 30
  • post_max_size = 50M
  • upload_max_filesize = 50M
  • date.timezone = "UTC"
  • max_input_vars = 2000

Share via

Related Articles

© Cooini, LLC