In this article, AZDIGI will show you how to change the PHP version for a subdomain on DirectAdmin with a few simple steps. In some cases, you create a subdomain and run it with a different website, but you don’t want to run the same PHP version with the main domain because the source code of both requires different PHP configurations. And how to solve that problem, you can refer to the steps below.
Step 1: Determine the Subdomain that needs to change PHP
First, you need to log in to your DirectAdmin. Next, you need to determine the subdomain to be manipulated and proceed to check the current PHP version in use before changing.
- The primary domain: thegioibecon.com
- Subdomain: sub.thegioibecon.com
Now I will create an info PHP file to check the PHP version on the main domain and subdomain first. You can refer to how to create the info file here.
After creating the info file and trying to access it, the result is that my main domain and subdomain are running the same PHP version, which is 7.2.
Step 2: Change the PHP version for the subdomain
To change PHP for a Subdomain, at the DirectAdmin interface, you access Account Manager => Subdomain Management
At the subdomain that needs to change PHP, click on the pen 🖍 icon corresponding to that subdomain.
Next, select the PHP version you need to change (1) and click Save (2).
If you see a message like this, you have successfully changed the PHP version.
Step 3: Check the result
After you have determined and changed the PHP version for the subdomain you need, you can access the previously created info file and check the PHP version between the main domain and the subdomain.
And below is my result after changing:
As you can see, I have successfully changed the PHP for the subdomain from 7.2 to 7.4.
Above are details on how to change the PHP version for a subdomain on DirectAdmin extremely simple. Changing PHP on a subdomain will help you a lot when creating many websites with different source codes on the subdomain. Hope this article is helpful to you, wish you success!
You can refer to other instructions at the link below:
If you need assistance, you can contact support in the ways below:
- Hotline 247: 028 730 24768 (Ext 0)
- Ticket/Email: You use the email to register for the service and send it directly to: firstname.lastname@example.org .