Updated: 15 November 2026 · Applies to: DirectAdmin with CustomBuild 2 (multiple PHP versions), CloudLinux PHP Selector

DirectAdmin lets you pick a different PHP version for each domain from Domain Setup, as long as the server has more than one PHP version installed. On CloudLinux servers you usually use Select PHP Version instead.

Change the PHP version of a domain

  1. Log in to DirectAdmin at User Level (usually https://your-server:2222).
  2. Open Domain Setup and click the domain you want to change.
  3. Find the PHP version selector on the domain's settings page and choose the version.
  4. Save. The change applies to that domain only; your other domains keep their own versions.

According to DirectAdmin, the first PHP version installed on the server is the default and is used by any domain you have not changed.

Change the version of one subdomain

DirectAdmin's documentation places the per-subdomain choice under Sub-Domains Setup, in the Document Root Override section, which has its own PHP Version Selector. Use it when, for example, shop.example.com runs an older application that needs a different PHP version from the main site.

Check which version a site really uses

Put a small file such as version.php in the site's public_html folder:

<?php echo PHP_VERSION, "\n";

Open https://example.com/version.php in the browser. It prints the version that served the page, for example in our lab test:

8.4.27

Remove the file afterwards. Checking this way rules out browser or cache confusion after a switch.

If the version you need is not listed

The selector only offers versions the server administrator has installed. On a shared hosting account, open a support ticket and ask for the version. On your own server, the administrator adds versions with CustomBuild. DirectAdmin's documented example sets three versions and rebuilds PHP:

da build set php1_mode php-fpm
da build set php1_release 8.1
da build set php2_release 5.6
da build set php3_release 7.0
da build php
da build rewrite_confs

Replace the version numbers with the ones you need; DirectAdmin supports up to nine slots (php1_release to php9_release), and an unused slot is set to no. The user selector is controlled by the php_version_selector setting, which DirectAdmin says is enabled by default. To check it:

da config-get php_version_selector

To enable it if it shows 0:

da config-set php_version_selector 1

These commands need root on the server and could not be run in our test environment, so they are taken from DirectAdmin's documentation.

Servers with CloudLinux

According to DirectAdmin, the CloudLinux PHP Selector needs php1_mode=lsphp, and when both selectors are in use, the CloudLinux choice applies only to domains on the first DirectAdmin PHP version. In practice: if your account shows Select PHP Version, use that tool, see How to Change PHP Version Using CloudLinux Selector in DirectAdmin. The same tool sets extensions and options such as upload size, see How to Manage PHP Extensions in DirectAdmin via CloudLinux Selector.

Before you switch

  • Check what your application supports. Very old PHP versions such as 5.6 and 7.0 no longer get security fixes from the PHP project; use them only for a site that cannot run on anything newer, and plan an upgrade.
  • Switch one domain at a time and test the site straight away, including logins and forms.
  • If the site shows errors after the switch, set the previous version back from the same screen.

Official documentation: DirectAdmin, multiple PHP versions.

Related services

Server management

on-demand administration, hardening, migrations and monitoring.

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Was this answer helpful?

Still stuck? Open a ticket