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

Overview

In WHM's MultiPHP Manager interface (WHM >> Home >> Software >> MultiPHP Manager), the term Inherit refers to how 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

Only one single default PHP version exists in EasyApache 4's MultiPHP environment. You set this default version at the system level. The system sets the PHP version of each new account 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 cPanel & WHM default document root of the current domain and continues up the directory tree until it finds an .htaccess file with PHP version information. Apache must locate 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 PHP version from WHM's  MultiPHP Manager  interface (WHM >> Home >> Software >> MultiPHP Manager).
  • If Apache finds an invalid version of PHP in the .htaccess file, it uses the system default PHP version 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 that you only set the PHP version in an .htaccess file in the document root. If you set your PHP version in an .htaccess file in another location, you may experience unexpected behavior.

Examples

In the following table, assume that the system uses PHP 7.1 by default. PHP inheritance follows the following path:

Domain nameTypePHP settingHas .htaccess file?Effective PHP version
blee.comPrimary domainInheritNo7.1

first.blee.com

SubdomainInheritNo7.1

second.blee.com

Subdomain7.0Yes7.0
foobar.comPrimary domain7.0Yes7.0

third.foobar.com

SubdomainInheritNo7.0

fourth.foobar.com

Subdomain5.6Yes5.6

Additional documentation