DirectAdmin PHP Version Not Changing? Here's How to Fix It

Priya

Content Writer & Researcher

Last Updated: 16 October 2026
DirectAdmin PHP Version Not Changing? Here's How to Fix It
πŸ–₯️

Is Your DirectAdmin PHP Version Switch Not Taking Effect?

Wrong PHP version means plugin incompatibilities, security vulnerabilities, and broken sites. CloudHouse Technologies manages DirectAdmin servers and handles PHP version migrations correctly β€” contact us today.

πŸ–₯️12,400+PCs Fixed
⭐4.9β˜…Google Rating
⚑<15 minAvg. Response
πŸ›‘οΈISO 27001Certified

You installed a new PHP version through DirectAdmin's CustomBuild, changed the setting, restarted Apache β€” and the site is still running the old PHP version. This is one of the most common administration headaches on DirectAdmin servers, and it happens because PHP version control in DirectAdmin operates at two separate levels that must both be configured correctly.

This guide explains exactly how DirectAdmin's PHP version system works, why changes often don't take effect, and how to fix each root cause step by step.

How PHP Version Selection Works in DirectAdmin

DirectAdmin with CustomBuild 2.0 supports up to four simultaneous PHP versions, defined in /usr/local/directadmin/custombuild/options.conf as php1_release through php4_release. PHP can run in three modes depending on how Apache and CustomBuild are configured:

  • PHP-FPM β€” recommended mode, each PHP version runs as a separate FastCGI process manager service
  • FastCGI (SuPHP/CGI) β€” older mode, PHP runs as CGI per request
  • mod_php β€” Apache module mode; only one PHP version can be active at a time server-wide

PHP version selection happens at two levels: the server global default set in CustomBuild, and per-domain settings set in DirectAdmin's Domain Setup. When the per-domain setting overrides the global, changing the global has no effect on that domain. This is the most common reason PHP version changes appear not to work.

πŸ’‘ None of these worked? Skip the guesswork.

Get Expert Help β†’

Step 1: Check the Domain-Level PHP Version Override

This is the first thing to check β€” it explains most "PHP version change not working" reports.

1Log in to DirectAdmin as admin or the domain owner

Navigate to DirectAdmin β†’ Account Manager β†’ List Accounts β†’ click the domain β†’ Domain Setup.

2Find the PHP Version Selector

In Domain Setup, look for a "PHP Version" or "PHP Version Selector" dropdown. If a specific PHP version is selected here, it overrides the server global. Change it to the version you want for this domain and click Save.

3As admin, check all domains at once via SSH
grep "php" /usr/local/directadmin/data/users/*/domains/*.conf | grep -v "^Binary" | head -30

This shows the PHP version configured per domain. A line like php1=yes means the domain is using PHP slot 1 (php1_release in options.conf). If you changed php2_release but the domain has php1=yes, the domain stays on php1.

1Navigate to the CustomBuild directory
cd /usr/local/directadmin/custombuild
2Build PHP for the slot you want to change

Replace 1 with the slot number (1-4) you are building:

./build php n

This builds all PHP slots. To build only a specific slot:

./build php1

The build process takes 15-30 minutes depending on server speed. Watch for any compilation errors in the output.

3Rewrite web server configuration files

After the build completes, regenerate all virtual host configuration files to pick up the new PHP binaries:

./build rewrite_confs

This is the step that most guides miss. Without it, Apache and Nginx continue using the old PHP binary paths even after a successful build.

4Restart the web server
systemctl restart httpd   # CentOS/AlmaLinux/Rocky
systemctl restart apache2  # Ubuntu/Debian

If using PHP-FPM, also restart the FPM services:

systemctl restart php-fpm*

Or restart all PHP-FPM services at once with DirectAdmin's service restart:

/usr/local/directadmin/directadmin restart httpd
1Check that FPM services are running for your PHP versions
systemctl status php-fpm*

If a PHP version service is not running, start it:

systemctl start php81-php-fpm   # example for PHP 8.1
2Regenerate FPM pool configurations
cd /usr/local/directadmin/custombuild
./build rewrite_confs
3Check that the socket or port for the PHP version is active
ls -la /var/run/php-fpm/

You should see socket files for each active PHP version. Missing sockets indicate the corresponding FPM service is not running or the pool config is missing.

1Create a phpinfo test file
echo '<?php phpinfo(); ?>' > /home/username/domains/yourdomain.com/public_html/info.php

Access https://yourdomain.com/info.php in a browser. The PHP Version line at the top confirms which version is running. Delete the file after checking:

rm /home/username/domains/yourdomain.com/public_html/info.php
2Verify from the command line
php -v

Note that the CLI PHP version and the web-served PHP version can differ. The CLI version is set separately and does not affect web requests.

3Use DirectAdmin's built-in PHP version checker

In DirectAdmin β†’ Admin Level β†’ CustomBuild β†’ Version Management, you can see all installed PHP versions and their current status.

For complex PHP version management on DirectAdmin servers, including migrating sites between PHP versions safely, CloudHouse Technologies provides managed DirectAdmin server administration with full CustomBuild expertise.

Get the Free Linux Server Admin Cheatsheet (PDF)

Essential commands for server management, networking, and troubleshooting β€” all on one printable page.

Running Linux servers? Let us manage them for you.

Our Managed Linux Server plans cover updates, security hardening, monitoring, and 24/7 incident response β€” so your servers stay up and your team stays focused.

  • Proactive OS patching and security updates
  • 24Γ—7 monitoring with instant alerting
  • Backup configuration and disaster recovery
  • Dedicated Linux engineers on call
See Pricing Plans β†’

What our customers say

β€œOur production server went down at 2 AM. CloudHouse had it back online in under 20 minutes. Incredible response time.”

Arun S.

CTO, SaaS Startup

β€œThey migrated our entire infrastructure from Ubuntu 18 to 22 with zero downtime. Couldn't have asked for better.”

Deepak N.

DevOps Lead

Frequently Asked Questions

The most likely cause is that the domain has a per-domain PHP version override set in Domain Setup. This overrides the server global. Go to DirectAdmin > Account Manager > List Accounts > domain > Domain Setup and check the PHP Version Selector. Also ensure you ran './build rewrite_confs' after the CustomBuild change, as this regenerates the Apache/Nginx virtual host configs to use the new PHP binary paths.

Need this done for you?

Server Management Service

Managed Linux and Windows servers: monitoring, patching, security and 24/7 support.

Learn more

Book your free 15-minute diagnosis

A certified technician will call you back within 15 minutes during business hours.

Share this article

Leave a Comment

Comments (0)

Loading comments...