UnderHost
Knowledgebase Docs

Changing PHP version in DirectAdmin

Switch PHP versions per domain and adjust PHP settings in DirectAdmin. Covers MultiPHP or PHP selector, common ini settings,

On this page

DirectAdmin supports multiple PHP versions per domain through a PHP selector interface. The available versions depend on what is installed on your specific server. Not every version from PHP 5.6 to 8.3 is guaranteed to be available.

Switch PHP version

The exact path depends on your DirectAdmin version and hosting configuration:

  1. Find the PHP selector

    Look under Advanced Features → PHP, Domain Setup → Manage Domain, or Extra Features → PHP Selector. The location varies slightly by DirectAdmin theme and server setup.

  2. Select your domain

    Choose the domain you want to change the PHP version for from the dropdown.

  3. Choose the PHP version

    Select the desired PHP version from the list and save.

The change takes effect immediately for new PHP processes. Reload your website to confirm.

PHP version not showing?

If the PHP selector is not visible in your DirectAdmin, the feature may not be enabled on your plan, or PHP version switching may require contacting support. Open a ticket if you need a specific PHP version that is not available.

Adjust PHP settings

Common PHP settings can be overridden per domain via a .htaccess file or a php.ini / php.ini.d file placed in your document root, depending on how PHP is configured on your server.

Common settings to adjust via .htaccess (Apache/mod_php or suPHP):

php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value memory_limit 256M
php_value max_execution_time 120

If PHP runs as FastCGI or PHP-FPM, .htaccess PHP directives may be ignored. In that case, place a php.ini file in public_html/:

upload_max_filesize = 64M
post_max_size = 64M
memory_limit = 256M
max_execution_time = 120

If you are unsure which method applies to your server, contact UnderHost support-they can confirm the PHP execution mode and the correct method for overriding settings.

Verify the active PHP version

Create a temporary file called phpinfo.php in public_html/ with this content:

<?php phpinfo(); ?>

Open it in a browser: https://yourdomain.com/phpinfo.php. The first line shows the active PHP version. Delete the file immediately after checking.

WordPress versionRecommended PHP
WordPress 6.x (current)PHP 8.1 or PHP 8.2
Older WordPress (5.x)PHP 7.4 minimum; 8.0+ preferred
WooCommercePHP 8.1 or 8.2 for best performance

Avoid PHP 7.2 and below-these are end-of-life and receive no security patches. If a plugin or theme requires PHP 5.6 or 7.0, the plugin is outdated and should be replaced.

Related: DirectAdmin overview | DirectAdmin error logs | cPanel PHP | WordPress 500 error

Was this article helpful?

Need DirectAdmin hosting?

DirectAdmin is available for customers who want a lightweight hosting control panel on compatible UnderHost services.

Related articles

Back to DirectAdmin