PHP settings and the .user.ini file

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
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Increase PHP memory limit

If you need PHP's memory limit to be increased, please do the following: Create a file called...

Wordpress on Windows IIS7

When installing wordpress on windows servers with IIS7, it is important to use the following...

Disable Pagespeed

On our shared servers, we have pagespeed module enabled in nginx (the front web server).  This...

How to create a .htaccess file

Creating a .htaccess is easier then it sounds. You can create an .htaccess file in any text...

Your own php error.log and displaying errors

Is your script not behaving as expected or producing a white page?   If so, it could be a PHP...