Skip to content

Custom PHP settings per directory with .user.ini files

On ruachost.com, you can override PHP configuration settings on a per‑directory basis using .user.ini files. This is useful when different applications in your account require different PHP settings.

  • Apply custom PHP directives without changing global server settings.
  • Configure settings for specific applications or directories.
  • Useful for managing multiple apps with different requirements (e.g., CMS vs. custom scripts).
  • A .user.ini file is similar to php.ini, but applies only to the directory where it is placed and its subdirectories.
  • PHP reads .user.ini files every few minutes (default: 300 seconds).
  • Directives inside .user.ini override global settings for that directory.
  1. Log in via FTP, SFTP, or File Manager.

  2. Navigate to the directory where you want custom settings.

  3. Create a file named:

    .user.ini

Insert the settings you want to override. For example:

display_errors = On
memory_limit = 256M
upload_max_filesize = 20M
  • Save the file in the target directory.
  • The settings will apply to scripts in that directory and subdirectories.

If you have two applications with different requirements:

  • App A needs error reporting enabled.
  • App B requires higher memory limits.

You can place separate .user.ini files in each application’s directory with the appropriate directives.