If there are several websites in one account, they may need different PHP versions. The recommended way is website isolation (Site Isolation): each domain gets its own PHP version and settings, and the websites cannot read each other's files – which is also more secure.

Log in to cPanel – see the article “1.2. Logging in to cPanel”.

1Turn on isolation for a domain

In the “Software” section of cPanel, open “Select PHP Version” (“PHP Selector” opens). Open the “Per Domain Settings” tab. Next to the domain, turn on the switch in the “ISOLATION” column and then choose the PHP version for this domain.

When isolation is turned on, the domain inherits the current account settings; further changes are independent. Check the website after turning on isolation.

Turn on isolation for a domain

A version for one folder only (.htaccess)

If you need a different version in one folder only, add these lines to the .htaccess file in that folder (example with PHP 8.3). For another version, change the number, for example alt-php82 or alt-php84.

<FilesMatch "\.(php|phtml)$">
SetHandler application/x-httpd-alt-php83___lsphp
</FilesMatch>

  • A version chosen this way uses the server's default extensions and settings, not the “PHP Selector” settings. The folder is not isolated from the other websites in the account.
  • Cron jobs and the php command over SSH use the account's PHP version.
  • If you turn on isolation later, remove the SetHandler lines from .htaccess.

If you run into any difficulties, just write to us and we will help. support@area.lv

Was this answer helpful? 100 Users Found This Useful (104 Votes)