Your hosting account has one main PHP version, which applies to your main domain and to every subdomain and addon domain. If one site needs a different version, for example an old app that only runs on PHP 7.4 while the rest of your sites use PHP 8.3, you can set it for that one folder with a few lines in its .htaccess file. The change applies immediately and you do not need to contact us.
Set the version for one subdomain or folder
- Log in to cPanel and open File Manager.
- Go to the folder of the subdomain or folder that needs the other version, for example
public_html/shop, or the folder you chose when you created the subdomain. - Open the
.htaccessfile in that folder, or create one. To see files that start with a dot, click Settings at the top right of File Manager and tick Show Hidden Files. - Add these lines at the top of the file:
<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
SetHandler application/x-httpd-alt-phpXX___lsphp
</FilesMatch>
- Replace
XXwith the version number without the dot, as in the table below. - Save the file. The new version applies to that folder straight away.
| PHP version | Write in place of XX |
|---|---|
| PHP 7.4 | 74 |
| PHP 8.1 | 81 |
| PHP 8.2 | 82 |
| PHP 8.3 | 83 |
| PHP 8.4 | 84 |
Use a version that appears in the version list of Select PHP Version in your cPanel. A version that is not in that list will not work.
Check that it works
For a WordPress site, go to Tools, then Site Health, then Info, and open Server. For any other site, create a file named info.php in the same folder with the line below, open it in your browser (for example shop.yourdomain.com/info.php), check the PHP version at the top, and delete the file when you are done.
<?php phpinfo();
Good to know
- The rest of your account keeps its main version. You change that one in Select PHP Version, not in
.htaccess. - The lines also apply to the folders inside that folder, unless one of them has its own lines with another version.
- The extensions you tick in Select PHP Version are for your main version. In
info.php, check that the extensions your site needs are loaded for the other version too. If one is missing, message us on Telegram with your domain name. - To go back to the main version, delete the lines from the
.htaccessfile and save it.
📘 Why not Per Domain Settings?
Select PHP Version has a Per Domain Settings tab, but it needs Site Isolation, which is not enabled on our servers, so its switches stay off. The .htaccess lines above do the same job.
This works on Premium (cPanel) hosting. On Standard hosting (DirectAdmin), message us on Telegram with your domain name and the version you need.

