Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
stylenone

Overview

This document provides advanced PHP configuration file information. Use this document to ensure that you set the appropriate .ini files for your configuration.

The php.ini files

The system searches for and reads php.ini files when PHP starts. When it loads a directive that a php.ini file specifies, it loads the first incident of each directive that it finds.  The system searches for php.ini files in the following order:

  1. A SAPI module specific location, such as the PHPIniDir directive in Apache, the PHP_INI_Path environmental variable, or the php_ini parameter in NSAPI. 
  2. The PHPRC environmental variable. 
  3. The current working directory.
  4. The webserver's SAPI module or PHP directory.
Warning
titleImportant:
  •  If a php-sapi.ini file exists, where sapi represents the SAPI in use, the system reads that file instead of the php.ini file.
  • The Apache web server changes to the root directory at startup, which causes PHP to read php.ini files that exist in the root user's directories.

In cPanel & WHM, the system also scans the .ini files that exist in the /opt/cpanel/ea-php##/root /etc/php.d/ directory. The system reads these files in alphabetical order. 

Note
titleNote:

To see the files that PHP loaded, you can execute the php_ini_scanned_files() function with your PHP script or run PHP with the --ini option.

PHP handlers and configuration files

CGI

The CGI handler executes PHP applications through the mod_cgi or the mod_cgid Apache modules.

The system only uses the values that the /opt/cpanel/ea-php##/root/etc/php.ini file or the.ini files in the /opt/cpanel/ea-php##/root /etc/php.d/ directory specify. The system reads these files in alphabetical order. 

DSO

The DSO handler embeds the PHP language inside the Apache webserver. DSO allows you to use Apache directives (for example, the php_value and php_admin_value directives).

The system only uses the values that the /opt/cpanel/ea-php##/root/etc/php.ini file or the.ini files in the /opt/cpanel/ea-php##/root /etc/php.d/ directory specify. The system reads these files in alphabetical order. 

FCGI Process Manager (FPM)

FastCGI serves PHP applications through the mod_proxy_fcgi Apache module.

The system loads the PHP INI values in the following order:

  1. The values that the /opt/cpanel/ea-php##/root/etc/php.ini file or the.ini files in the /opt/cpanel/ea-php##/root /etc/php.d/ directory specify. The system reads these files in alphabetical order. 
  2. The /opt/cpanel/ea-php##/root/etc/php-fpm.conf file.

    Note
    titleNote:

    If a key that starts with php_admin_* exists, it will override the system default value or any previously found value.


  3. The .conf files in the /opt/cpanel/ea-php##/root/etc/php-fpm.d/ directory.

 

Warning
titleImportant:

Do not edit the /opt/cpanel/ea-php##/root/etc/php-fpm.conf file or the files in the /opt/cpanel/ea-php##/root/etc/php-fpm.d/ directory. If you wish to make changes, you must edit the PHP-FPM .yaml files.

For more information, read our PHP-FPM documentation. 

FCGI daemon (FCGId)

FCGId serves PHP applications through the mod_fcgid Apache module. The mod_fcgid Apache module is an alternative to the mod_cgi Apache module.

The system only uses the values that the /opt/cpanel/ea-php##/root/etc/php.ini file or the.ini files in the /opt/cpanel/ea-php##/root /etc/php.d/ directory specify. The system reads these files in alphabetical order. 

Warning
titleImportant:

You can only use FCGId with MultiPHP on systems that run cPanel & WHM version 74 or later. If your default PHP version uses FCGId, then all PHP versions will use FCGId.

For more information, read our Apache Module: FCGId documentation.

suPHP

This option provides the ability to run PHP scripts as the user with the mod_suphp Apache module.

Include Page
LIB:_EA4suPHP
LIB:_EA4suPHP

Additional documentation

Localtab Group


Localtab
activetrue
titleSuggested documentation

Content by Label
showLabelsfalse
max5
showSpacefalse
cqllabel in ("ea4","php","phphandlers") and label = "whm" and space = currentSpace()


Localtab
titleFor cPanel users

Content by Label
showLabelsfalse
max5
showSpacefalse
cqllabel in ("ea4","php","phphandlers") and label = "cpanel" and space = "ALD"


Localtab
titleFor WHM users

Content by Label
showLabelsfalse
max5
showSpacefalse
cqllabel in ("ea4","php","phphandlers") and label = "whm" and space in ("ALD","CKB")


Localtab
titleFor developers

Content by Label
showLabelsfalse
max5
showSpacefalse
cqllabel in ("ea4","php","phphandlers") and space = "DD"