Skip to Content
Shared hosting (cPanel)Using cPanelSoftware

MultiPHP INI Editor

This interface lets you configure PHP directives, which control how PHP behaves, such as restricting scripts' ability to access or execute local files. You can configure the basic directives in the Basic Mode tab, or add new directives in the Editor Mode tab.

Basic Mode

Choose the php.ini file you want to configure from the menu, which lists all your available domains as well as your Home Directory. Choose the home directory to apply the changes to all your sites, or choose a specific domain to apply them to that domain only; your PHP directives will then appear.

Tip

For security reasons, we strongly recommend using the default values that cPanel provides.

Note

Available directives depend on your PHP version; if a particular directive doesn't appear, your current version doesn't support it.

The directives customers most often need to change:

  • upload_max_filesize and post_max_size: The largest file size that can be uploaded through your site (such as WordPress themes or import files). Set post_max_size to the same value or higher.
  • memory_limit: The memory available to each PHP script. Raise it if you see the message Allowed memory size exhausted.
  • max_execution_time: The maximum time, in seconds, a script can run before it's stopped. Raise it for long-running operations such as imports.
  • display_errors: Keep this disabled on a live site so error details aren't shown to visitors.

Make the changes you need to the directives, then click Apply. The system saves the changes to the php.ini, .user.ini and .htaccess files (if they support the directive), and the contents of these files may not match each other exactly.

Editor Mode

Choose the php.ini file you want to edit in the same way (a specific domain or the home directory); if the file doesn't exist, the interface opens an empty editor so you can create a new one.

Warning

Be very careful when editing in this mode; mistakes can break your PHP scripts, and this interface is recommended for advanced users only.

The following words can't be used as directives: null, yes, no, true, false, on, off, none. Directives also can't contain these characters: ? { } | & ~ ! [ ( ) ^ "‎.

Make your changes, then click Save. The system saves the changes to the php.ini file at the path shown in the interface, to the .user.ini file, and to the .htaccess file if it supports the directive.

Note

The interface performs a basic validation of directive names, but this doesn't guarantee that your PHP settings will work correctly. To reset your PHP settings to their defaults, delete the php.ini file for the domain or home directory.

The PHP DSO handler and major versions

Note

cPanel & WHM does not support the DSO handler with PHP 8.0 and later.

If the server administrator has enabled the DSO handler and you change your PHP version to a different major version (for example, from PHP 5 to PHP 7), the system won't read your configuration changes. To fix this, edit your PHP settings and save them again in this interface, and the system will load the .htaccess directives correctly.

The LSAPI module and the .htaccess file

If the server administrator uses the LSAPI module in your PHP configuration, the system automatically adds an LSAPI section to the .htaccess file, in a format similar to the following:

<IfModule lsapi_module>
      php_value date.timezone "Asia/Damascus"
      php_value memory_limit 128M
      php_value upload_max_filesize 60M
</IfModule>

How is this guide?

On this page