IndicHosts.net provides multiple PHP versions ranging from PHP version 4.4.xxx to PHP 8.4.xxx to use with your domain and website. Linux web hosting is built on cPanel or DirectAdmin GUI control panels. If you are using cPanel as your Control Panel, for each version of PHP (say 8.1) we further provide two types of PHP namely ea-php and alt-php;
- ea-php is the default version of PHP provided through cPanel, and is based on the publicly available PHP open source repository. ea-php is the recommended version of PHP to be used with your website if you decide to use PHP-FPM as the PHP handler for your website.
- alt-php is the commercial version of secure PHP with security fixes and updates applied to the open source repository versions. alt-php is the recommended version of PHP to be used with your website, if your website requires an outdated version of PHP which is no longer supported by the PHP open source repository.
Tools for Setup of PHP environment for your website: We provide following tools namely "MultiPHP Manager", "MultiPHP INI Editor" and PHP Selector (or "Select PHP version") to setup the PHP version, handler, extensions and variables for your domains. These tools have specific functions and need to be used accordingly;

MultiPHP Manager is an interface tool for choosing an ea-php version from PHP 8.0.xxx to PHP 8.4.xxx (supported PHP versions as on date of writing the article supported by php.net). MultiPHP manager is the only interface to be used if you wish to use PHP-FPM (FastCGI Process Manager) as your PHP handler for your website's PHP. PHP-FPM is only supported on ea-php on our servers.

MultiPHP INI Editor is the interface tool to configure custom PHP extensions, variables and settings for ea-php, if ea-php is selected for use with your website in the MultiPHP Manager (as explained above). For the ea-php version deployed on your domain, you can enable / disable PHP extensions and/or define custom PHP variables per directory under public_html.

Select PHP Version or "PHP Selector" as it is commonly known, is the interface tool to be used if you decide to use a commercial hardened, secure PHP version between 4.4.xxx to PHP 8.4.xxx with your with Mod_LSAPI Pro as the php handler.
If in doubt, IndicHosts.net recommends using alt-php to power your domains as;
- alt-php versions are supported (secured and hardened) for years beyond the official End Of Life date of the php version.
- alt-php versions will-not be removed from the server once the End Of Life date is reached for that PHP version, whereas ea-php versions will be removed from the server as soon as the End Of Life date is reached for that PHP version, forcing your script to switch to a supported PHP version.
Use the "Select PHP Version" or "PHP Selector" to set up PHP versions, extensions, handlers and variables for your domains?
-
- Step 1: To enable the "PHP Selector" goto MultiPHP Manager and set the domain or subdomains to use PHP version "inherit". Please note that this is a mandatory requirement, without which the PHP selector will not function. Setting the PHP version to inherit tells the Control Panel to disable ea-PHP and enable alt-PHP on your domain.

- Step 2: Go to "Select PHP Version" or "PHP Selector" and set "Current PHP Version" to any version other than the "inherit" version. This tells the Control Panel that you would like to setup extensions and variables in your PHP environment differently from the default-setup of extensions and variables in the selected PHP version. IndicHosts.net recommends that you select any PHP version other than the "native" version for your website.

- Step 3: Goto Extensions tab of Select PHP Version or "PHP Selector" & select the PHP extensions of your choice. You can enable or disable them by clicking the box next to the extension name.

- Step 4: Go to the Options tab of the "Select PHP Version" or "PHP Selector" and modify the PHP variable options as required for your website. Listed here are the most commonly used PHP variables and options that clients want to modify for their domains. If you need any other PHP variable or option modified, which is not available on this page, you can set that variable using the MultiPHP INI Editor or get in touch with us to set it up for you.

- Step 5: Add a phpinfo() php file to your domain root to verify that the correct PHP environment has been set up for your domain. The code to be added in a file is given below;
<?php phpinfo(); ?>
Then try to access the php file in your browser to see the PHP environment information as given below. Sometimes as a security measure, the phpinfo function may be disabled in your PHP environment and the phpinfo data may not render in the browser. If this happens, you can remove the phpinfo function from the disable_functions option in PHP Selector >> Options Tab >> disable_functions and then try to load the file in browser.

How to enable PHP-FPM as the PHP handler for your domain?
PHP-FPM or FastCGI Process Manager is an advanced, highly-efficient processor for the PHP scripting language. WordPress websites configured to use PHP-FPM can handle higher amounts of website traffic while using fewer server resources than other PHP handlers. PHP-FPM dramatically speeds up the performance of your PHP environment compared to traditional PHP handlers like DSO, CGI and suPHP. However, compared to alt-php's Mod_LSAPI Pro, the website speed difference is marginal. Here are the simple steps to enable PHP-FPM on your domain;
- Step 1: Go to MultiPHP Manager and select an ea-php version to power your domain.
- Step 2: Raise a support ticket and request us to have PHP-FPM to be enabled on the domain.
- Step 3: Visit the MultiPHP INI Manager and setup the custom extensions and variables for your domain
- Step 4: Visit your phpinfo() page and verify that PHP-FPM is enabled on your domain

How to Setup a Subdomain or Addon Domain to use a different version of PHP than the primary domain?
Clients at times use different scripts on subdomains which require a separate PHP environment setup, different from the primary domain's PHP environment. The difference could be in the PHP version, handler, extensions and/or variables. We recommend that such sub-domains be deployed as a separate cPanel account, for ease of use and management. However, if a separate cPanel account is a constraint, advanced website developers and administrators can achieve a completely separate PHP setup for a subdomain. Let's see how to do this;
Steps to setup different PHP versions per directory or subdomain using alt-php with mod_lsapi
-
- Step 1: Goto the http root of the subdomain and create a .htaccess file in the desired directory where you want to have a different from default PHP version with the right handler with the following commands
-
-
To load a different ea-php version:
<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
SetHandler application/x-httpd-ea-php80-lsphp
</FilesMatch>
-
To load a different alt-php version:
<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
SetHandler application/x-httpd-alt-php82___lsphp
</FilesMatch>
Please change the php71 to the version number you need.
Note! If you have a non-native version selected for the primary domain. If the version that you assign through .htaccess is the same as the ea-php version selected as the system default version, that version will not be applied, the version that you'll get will be the same as selected in PHP Selector.
- Step 2: To modify the default PHP extensions, variables, and options for the custom PHP version applied to the subdomain or subdirectory above, use the MultiPHP INI Editor to setup a custom php.ini for the subdomain or subdirectory.
- Step 3: Visit your phpinfo() page and verify that PHP-FPM is enabled on your domain
Steps to setup different PHP versions per subdomain using ea-php with suPHP or PHP-FPM
-
- Step 1: To enable ea-php on a subdomain goto MultiPHP Manager and enable ea-php version on the subdomain.
- Step 2: Visit your phpinfo() page and verify that ea-php is enabled on the sub-domain.
- Step 3: Create a ticket and ask us to enable PHP-FPM on the sub-domain.
Steps to setup different PHP versions per subdirectory using ea-php with suPHP
-
- Step 1: Create a .htaccess file in the subdirectory and add the following code;
# php -- BEGIN cPanel-generated handler, do not edit
<IfModule mime_module>
AddHandler application/x-httpd-ea-php81 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
You can change the term php81 above to any other version of ea-php available on the server such as php80 or php82 or php74
- Step 2: Visit your phpinfo() page and verify that ea-php is enabled on the sub-domain.
Note: Currently enabling PHP-FPM on a sub-directory with mapping a sub-domain or addon domain to it is not supported.