A .user.ini file can override permitted PHP settings for a website directory when PHP runs through CGI or FastCGI, including typical PHP-FPM setups. It is useful when you cannot edit the server’s main PHP configuration.

Check support first

Confirm that your provider supports .user.ini for the site’s PHP handler. Only allowed settings can be changed; server-enforced limits may still apply. A control-panel PHP settings page may be the preferred method for your account.

Create or edit the file

  1. Open the site’s actual document root through File Manager or a secure file-transfer connection.
  2. Show hidden files and look for .user.ini.
  3. Keep a copy if the file exists. Otherwise, create a file with that exact name, including the leading dot.
  4. Add only the settings you need. For example:
memory_limit = 256M
upload_max_filesize = 64M
post_max_size = 80M
max_execution_time = 120
  1. Save the file. Review these example values against the application’s needs and your account limits.

post_max_size must allow for the entire request, so it should be larger than upload_max_filesize when allowing a file of that size.

Confirm the effective settings

PHP caches these files; the default refresh interval is five minutes, but the server may use another value. Check the application’s PHP information page after that interval and test the relevant function.

The file affects applicable PHP requests in its directory and child directories within PHP’s configuration-search scope. It does not change command-line PHP settings. Remove any temporary public PHP information page after checking it.