Welcome to Your Hosting Talk! Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!
PHP Selector is a tool that enables users on the server to have their own fully customizable and flexible PHP environment. It allows the user to switch between different PHP Versions, such as PHP 5.2, PHP 5.3, PHP 5.6, PHP 7.0, and PHP 7.1, based on the user's needs.
You can configure the server to use different PHP versions on your subdomains and directories by adding the SetHandler code in the .htaccessfile of the folder to override the default PHP version.
You can follow the steps below to configure the PHP versions for your subdomains or directories PHP Selector.
Login to your cPanel
Navigate to the Software section > Select PHP Version
Now, select the desired PHP version from the drop-down list, click Set as current and Save the change.
Thus, a new PHP version is now enabled for each subdomain or folder. You can also use different PHP versions per directories by using mod_lsapi,
Firstly, setup mod_lsapi
Now, for EasyApache 4 servers - you should already have a /etc/container/php.handler file.
You will have to create a .htaccess file in the desired directory where you want a different PHP version with the correct handler.
Include the below code to the .htaccess file for the EasyApache4 server: