Question
What exactly is PHP inheritance, and how does this work with cPanel?
Answer
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.
PHP inheritance follows the following path:
-
You set the PHP version at the system level.
-
You set a cPanel account or domain to use the Inherit option in WHM’s MultiPHP Manager interface (WHM >> Home >> Software >> MultiPHP Manager).
-
Apache searches the cPanel & WHM default document root of the current domain and continues up the directory tree until it finds a
.htaccess
file with PHP version information. -
Apache locates a
.htaccess
file with PHP version information. -
Each cPanel account or domain set to Inherit now uses the PHP version in the
.htaccess
file.
- 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 (WHM >> Home >> Software >> MultiPHP Manager).
For more on this, please refer to our excellent documentation here: https://docs.cpanel.net/ea4/php/php-inheritance/
Comments
0 comments
Article is closed for comments.