Valid for versions 82 through the latest version
Last modified: August 9, 2022
Overview
This interface allows you to configure your PHP settings. The PHP scripting language generates web pages.
For more information about a directive, search the php.net documentation.
cPanel users can view information about the servers PHP configuration in cPanels MultiPHP INI Editor interface (cPanel » Home » Software » MultiPHP INI Editor).
MultiPHP INI Editor
Select the PHP version that you wish to configure from the menu. The PHP directives will appear.
Basic Mode
The Basic Mode section of this interface loads the directive values from the php.ini file for the version of PHP that you select. Make your changes to the desired directives and click Save.
The system saves the settings to the /opt/cpanel/<your_php_package>/root/etc/php.ini file, where <your_php_package> represents the name of the PHP package that contains the .ini file that you wish to edit.
allow_url_fopenSelect whether PHP scripts can use URL-awarefopenwrappers. This setting defaults to Enabled.allow_url_includeSelect whether PHP scripts can use URL-aware fopen wrappers with the following functions:include()include_once()require()require_once()This setting defaults to Disabled.
asp_tagsSelect whether PHP scripts can use ASP-like tags in addition to PHP tags. This setting defaults to Disabled.Note:This includes variable-value printing shorthand (for example,
<%= $value %>).display_errorsSelect whether PHP displays errors as output or hides them from the user. This setting defaults to Disabled.enable_dlSelect whether scripts can call thedlfunction. This function dynamically loads a PHP extension at runtime. This setting defaults to Disabled.Warning:If you set this directive to Enabled, it poses security risks to your server. We strongly recommend that you select Disabled unless you absolutely require thedlfunction.file_uploadsSelect whether your PHP scripts can upload HTTP files. This setting defaults to Disabled.magic_quotes_gpcSelect whether PHP automatically escapes certain characters with a backslash (\). This setting defaults to Disabled.max_execution_timeEnter the maximum amount of time, in seconds, that your server allows a script to run before your server terminates it. This setting limits the amount of memory that poorly-written scripts may use. This setting defaults to30.max_input_timeEnter the maximum amount of time, in seconds, that your server allows a script to parse input data. This setting defaults to-1.max_input_varsEnter the maximum number of input variables per request. Use this directive to deter Denial of Service (DoS) attacks that use hash collisions on input variable names. This setting defaults to1000.memory_limitEnter the maximum amount of memory that scripts can allocate, in bytes. This setting helps to prevent poorly-written scripts that may use too much memory. cPanel & WHM adjusts this setting at the time of install, based on system memory:- 1 GB
32M - 2 - 4GB
64M - Over 4 GB
128MNote:Use the characterMto define the limit in megabytes.
- 1 GB
post_max_sizeEnter the maximum size of post data that the system allows, in bytes. This setting affects file uploads. Set this value to 0 to allow unlimited post sizes. This setting defaults to8M.Note:- We strongly recommend that you set this value larger than the
upload_max_filesizevalue and smaller than thememory_limitvalue. - Use the character
Mto define the limit in megabytes.
- We strongly recommend that you set this value larger than the
register_globalsSelect whether GET or POST input converts into variables that the script can use. This setting defaults to Disabled.safe_modeSelect whether to enable safe mode. Safe mode increases security for PHP scripts and enables user, group, and environment checks and controls. This setting defaults to Disabled.session.save_pathEnter the directory in which your server stores the files that PHP creates. This setting defaults toNULL.Important:- The system saves PHP sessions in the
/var/cpanel/php/sessionsdirectory by default. EasyApache 4 installations create subdirectories based on the version of PHP that exists on the server. If multiple versions of PHP exist on the system, a subdirectory exists for each version of PHP. Therootuser owns each directory, and each directory possesses1733permissions. This allows PHP to write session files, but users will not possess permissions to delete those sessions in the directory. Because PHP writes setting files, PHP cannot clean its own sessions. Therefore, therootuser must run a cron job to delete the expired session files. - Do not change the
session.save_pathsetting to the/tmpdirectory or a directory that other users or programs use. If you change thesession.save_pathsettings value to another directory, the system will change the directorys permissions to1733. This will likely break other programs functionality. If you must use the/tmpdirectory, create a subdirectory under the/tmpdirectory in which the system will save the PHP session files.
Note:If you change thesession.save_pathsetting in thephp.iniconfiguration file, the cron job will continue to clean up the sessions files in the specified directory. When the system runs the cron job, it will ensure that the configuration file possesses the correct directory permissions.- The system saves PHP sessions in the
session.gc_maxlifetimeEnter the maximum amount of time, in seconds, for the lifetime of a session file. If a session lasts longer than thesession.max_lifetime, the system marks it for deletion the next time that it performs a session cleanup. Each version of PHP that you install on the system uses this setting. This setting defaults to1440seconds (24 minutes).Note:Session files can exist on the filesystem for longer than thesession.max_lifetimesetting. Because session cleanup occurs every 30 minutes, a session file could exist for up to itssession.max_lifetimevalue plus 30 minutes.session.gc_probabilityBecause a cron job cleans up the session files, the system does not require this setting. If you enable this setting, PHP will attempt to delete expired files, which will fail. This setting defaults to0.session.gc_divisorBecause a cron job cleans up the session files, the system does not require this setting. If you enable this setting, PHP will attempt to delete expired files, which will fail. This setting defaults to0.upload_max_filesizeEnter the maximum file size for an upload, in bytes.This setting defaults to2M.Note:Use the characterMto define the limit in megabytes.zlib.output_compressionSelect whether to transparently compress pages when the browser sends anAccept-Encoding: gzipordeflateheader. This setting defaults to Disabled.
Editor Mode
- Exercise extreme caution when you make changes in this interface, because errors could result in non-functional PHP scripts. Only advanced users should use this interface.
- Do not use the following reserved terms as directives:
nullyesnotruefalseonoffnone
- Directives cannot contain any the following special characters:
?{}|&~