Knowledge Base

DirectAdmin - Using different PHP versions with different domain/directory

For Apache webserver:

Create .htaccess file with the following code :

SetHandler application/x-httpd-php56

The actual change is made by switching the SetHandler line with one of these depending on the version:

SetHandler application/x-httpd-php73
SetHandler application/x-httpd-php70
SetHandler application/x-httpd-php56
SetHandler application/x-httpd-php55

For LiteSpeed webserver:

AddType application/x-httpd-php56 .php5 .php4 .php .php3 .php2 .phtml

The actual change is made by switching the SetHandler line with one of these depending on the version:

AddType application/x-httpd-php73
AddType application/x-httpd-php70
AddType application/x-httpd-php56
AddType application/x-httpd-php55

Please rate this article to help us improve our Knowledge Base.

2 1