Page tree
Skip to end of metadata
Go to start of metadata

Important:

WHM's MultiPHP Manager interface (WHM >> Home >> Software >> MultiPHP Manager) is only available on systems that run EasyApache 4.  

Overview

EasyApache 4 introduced the MultiPHP system. In WHM's MultiPHP Manager interface (WHM >> Home >> Software >> MultiPHP Manager), the term Inherit refers to the way that Apache determines a domain or virtual host's PHP version. When you set an account or domain to Inherit, Apache uses the PHP version that exists in the first .htaccess file that it finds in the domain's file structure. 

How inheritance works

In EasyApache 4's MultiPHP environment, one single default version of PHP exists. This default version is set at the system level. The system sets all new accounts' PHP version to the Inherit value by default, which indicates that no explicitly set version of PHP exists for the account.  

When the system searches for the version of PHP to use, it starts in the current domain's document root as defined by cPanel's defaults, and continues up the directory tree until it finds an .htaccess file with PHP version information. Apache must find an .htaccess file to properly inherit a PHP version from a primary domain. If Apache does not find an .htaccess file, it uses the system default set in WHM's MultiPHP Manager interface. If Apache finds an invalid version of PHP in the .htaccess file, it uses the system default set in WHM's MultiPHP Manager interface. 

Notes:

  • For a primary domain, the default document root is the /$HOME/user/public_html directory.
  • For a subdomain or addon domain, the default document root depends on your server's settings. For more information, read our Tweak Settings - Domains documentation.

Important:

We strongly recommend only setting the PHP version in an .htaccess file located in the document root. If you set the version in an .htaccess file located anywhere else, you may experience unexpected behavior.

Examples

 

How inheritance works with EasyApache 4's MultiPHP


In this example, the system default version of PHP is PHP 5.5. The inheritance works as follows:

  • The primary domain blee.com is set to Inherit. It has two subdomains, first.blee.com, which is also set to Inherit, and second.blee.com, which is set to use PHP 5.4.
    • The subdomain first.blee.com uses PHP 5.5. 
    • The subdomain second.blee.com uses PHP 5.4
  • The primary domain foobar.com is set to PHP 5.4. It has two subdomains, third.foobar.com, which is set to Inherit, and fourth.foobar.com, which is set to use PHP 5.5. 
    • The subdomain third.foobar.com uses PHP 5.4
    • The subdomain fourth.foobar.com uses PHP 5.5

Additional documentation