Your search returned no hits.
95% of all problems already have a solution in our knowledgebase
Added: 17.12.2018 15:38:29 Last updated: 08.07.2020 12:45:27
It is possible to set different PHP versions in folders by using a .htaccess file on our cPanel web hosting.
For most clients this is not needed, but those who have different scripts and many domains in the same hosting package where different PHP versions are required it is useful.
We recommend following the below method if the above apply to you. Otherwise we recommend using the PHP Selector inside cPanel to have the same version for all folders.
Find the desired folder trough File Manager / FTP / SSH. If there is no .htaccess file from before, it must be created. If it exists from before, you can change the existing one and enter the lines below to change the PHP version.
The example below changes the PHP version to PHP 7.0.
These PHP versions can be used:
application/x-httpd-alt-php44___lsphp - PHP 4.4
application/x-httpd-alt-php51___lsphp - PHP 5.1
application/x-httpd-alt-php52___lsphp - PHP 5.2
application/x-httpd-alt-php53___lsphp - PHP 5.3
application/x-httpd-alt-php54___lsphp - PHP 5.4
application/x-httpd-alt-php55___lsphp - PHP 5.5
application/x-httpd-alt-php56___lsphp - PHP 5.6
application/x-httpd-alt-php70___lsphp - PHP 7.0
application/x-httpd-alt-php71___lsphp - PHP 7.1
application/x-httpd-alt-php72___lsphp - PHP 7.2
application/x-httpd-alt-php73___lsphp - PHP 7.3
To select and modify PHP extensions for the PHP versions used in other folders, it can be done inside the PHP Selector in cPanel as shown in the picture below.