🐘
Hosting

Sometimes you host several sites on one account but each needs a different PHP version — a new site wants PHP 8.3 for speed and security, while an older site still needs PHP 7.4 because legacy plugins don’t support the newer release. The good news: DirectAdmin lets you set a different PHP version per domain yourself, no separate hosting required.

In short: on DirectAdmin you pick a PHP version per domain via Select PHP Version, and you can even target a subfolder with an .htaccess rule — so old and new sites coexist on a single account.

Why run multiple PHP versions?

PHP versions differ in compatibility. Common reasons to run several:

Choose a PHP version per domain

The most basic method is the DirectAdmin Select PHP Version page:

  1. Log in to DirectAdmin and open Select PHP Version (some themes expose a per-domain PHP option under Domain Setup).
  2. Pick the domain you want (if your account has several).
  3. Choose the PHP version — 7.4, 8.1, 8.2 or 8.3 — and save.
  4. Open the site and confirm it runs without version-related errors.

This change applies to that whole domain and does not affect the other domains on the same account.

Set PHP per folder with .htaccess

To make only a certain folder use a different PHP version, use .htaccess in that folder (the exact directive depends on the server; a common LiteSpeed/CloudLinux example):

<FilesMatch "\.php$">
  SetHandler application/x-lsphp82
</FilesMatch>

This suits separating staging from production on one domain, or a sub-app installed in a subfolder. If you’re unsure of the correct handler value, ask support, as it varies per server.

Caution: a wrong handler value can make the page display raw PHP code or throw a 500 error. Test immediately after editing, and keep a copy of the original .htaccess so you can revert.

Choosing the right PHP version

VersionStatusBest for
PHP 7.4End of life (no security updates)Only legacy sites you can’t move yet — upgrade soon
PHP 8.1Still maintainedSites wanting stability and broad compatibility
PHP 8.2 / 8.3Latest, fully maintainedNew sites wanting maximum speed and security

The rule of thumb: use the newest version your site supports, and aim to move any site stuck on old PHP onto a still-supported version quickly, because an end-of-life version is a security risk that only grows over time.

Impact on plugin and theme compatibility

Changing the PHP version affects not just the WordPress core but every plugin and theme installed. Well-maintained, regularly updated plugins usually already support newer PHP, but old abandoned plugins may use functions removed in PHP 8, causing an error or a white screen right after switching.

The safe path: before a major upgrade, check the WordPress Site Health page, which warns of potentially incompatible plugins or themes. Then update every plugin and theme to the latest version first, and test on staging or a test folder set to the new PHP version before switching the live site.

If a plugin doesn't support the new version and has no update, your options are to find an equivalent replacement, or keep that domain/folder on the old version temporarily using the method above and plan the move later. The freedom to choose PHP per domain means you never have to force-upgrade the whole account at once and risk taking sites down.

Verify the version actually in use

After configuring, confirm each site really runs the version you intended:

What to know before switching

Summary: DirectAdmin lets old and new sites share one account by choosing PHP per domain or per folder. Use the opportunity to gradually move legacy sites onto safer versions, one at a time.

Frequently Asked Questions

Does changing PHP version affect other domains?

No. Selecting PHP via Select PHP Version only affects the chosen domain; other domains on the account keep their version, and you can also target a single folder with .htaccess.

Can an old site keep using PHP 7.4?

Technically yes, but PHP 7.4 is end-of-life with no security updates. Use it only temporarily for sites you can’t move yet, and plan to upgrade to a supported version as soon as possible.

The site shows a 500 error after changing version — how do I fix it?

Usually the code or a plugin is incompatible, or the .htaccess handler value is wrong. Check the error log, revert to the previous version first, then update the code/plugins for compatibility before switching again.

Do I need to re-enable extensions after changing version?

Sometimes, because extension settings are tied to each version. After switching, verify the extensions your site needs — such as OPcache, mysqli, gd — are enabled in the new version.

Hosting with multiple selectable PHP versions on DirectAdmin

AsiaGB Hosting supports multiple PHP versions you can choose per domain in DirectAdmin, on SSD — from 500 THB/year with a Thai support team.

See hosting plans

View all cheap Thailand web hosting plans →