Additional domain has different php version

d.dobrev

Verified User
Joined
Mar 20, 2018
Messages
56
Hello,

So, primary domain for an account is domain.com - set as php-fpm 8.2
I've created a 2nd domain dev.domain.com under the same account (so it'd have a separate public_html directory) but it's with php-fpm 7.4 (which is php1_release) and not 8.2 ?
And when I try to change the version - it tells me that only the primary domain can change the php version, which is already exactly what I need it to be.

```

PHP Settings cannot be controlled under this domain​

Domain 'dev.domain.com' is using php-fpm.
Only the default 'domain.com' domain is able to control the php settings.
```

Already tried switching the php version of the primary domain to 8.0 and back to 8.2 without any effect on the dev. domain...

php1 = 7.4
php2 = 8.2
php3 = 8.0
php4 = 7.3
DA 1.657 (aa282043f7809054a5b18e1e839716062ba2e621)

Any ideas?
 
Last edited:
I've created a 2nd domain dev.domain.com under the same account (so it'd have a separate public_html directory)
If you want to use the same php version on both the domain and the subdomain, just remove the dev.domain.com and add it again as a subdomain. Nowadays a seperate public_html is created when creating a subdomain, and you can even set a custom public_html if needed.

If you want to do it like you did now, change your options.conf and make php 8.2 the default php version. I would do that anyway as 7.4 is EOL, you can always switch php 1 and 2.
 
What I mean is ... if the php version can't be changed - why doesn't it match the php-fpm version of the "default" domain for that account?
So.. it could be changed but... someone placed arbitrary restrictions ... or is this a bug maybe, I don't know..
 
if the php version can't be changed - why doesn't it match the php-fpm version of the "default" domain for that account?
If things can't be changed, the default DA version is always used. As far as I know that is not a bug, that's working as designed.

If I'm correct you can change it if you create the subdomain the way it should be created. And since also a seperate public_html is created there, then there is no need to create it so it can be done if you use the subdomain as seperate domain.
These things were not possible yet a couple of years ago by default.
 
But what if I have completely different domain (domain1.com and domain22.com) and need to set it (domain22.com) to different PHP version, what then?
 
to different PHP version, what then?
Just select the domain you want to change it on and use the domain setup to change it.
We are talking subdomains here in this thread. You can give every main domain you want the php version you would like.
So just select the one you want per domain, it's no problem.
 
Thank you, Richard for your reply! When I press to change the php version for the domain I get the same error:

PHP Settings cannot be controlled under this domain​


Domain 'domain1.com' is using php-fpm.
Only the default 'domain0.com' domain is able to control the php settings.
 
Only the default 'domain0.com' domain is able to control the php settings.

It seems you do it in the wrong page. You should first go to a list of domains, i.e. on the "Domain Setup" page -> choose a domain in the list in the table -> PHP Version Selector, instead of switching the domain in the selector.
 
It seems you do it in the wrong page. You should first go to a list of domains, i.e. on the "Domain Setup" page -> choose a domain in the list in the table -> PHP Version Selector, instead of switching the domain in the selector
Thank you, zEitEr! This solved my issue! I don't know why there are two places for changing php version, it makes changing php version a bit unclear.
 
why there are two places for changing php version,
I'm not aware of that either. What is the other place then next to the domain setup page? I thought that was the only one. Now I'm curious. :)
Or maybe it's like that in Evo skin, I use Enhanced skin, maybe it's that.
 
I'm not aware of that either. What is the other place then next to the domain setup page? I thought that was the only one. Now I'm curious. :)
Or maybe it's like that in Evo skin, I use Enhanced skin, maybe it's that.
You have this link (see the image below) available for every domain, but when you click it for the domain that is not the main one, there will be an error message shown.
Screenshot 2025-05-17 115747.png
One solution there could be an option to change the domain's version right where it is in the image above. Another solution is when you press Domain setup, you could see "php version" for each domain, similarly as it is done for "subdomain setup" section.
Screenshot 2025-05-17 122419.pngOtherwise it is confusing in "Subdomain setup" section you see "PHP version" and you can change it, in "main domain general" section you see "PHP version" and you can change it, in other domains' main sections you can see "PHP version" and you can press it, but cannot change it. At the same time you need to open "Domain setup" section, then press on selected domain and somehow notice small link called "PHP version selector". To be honest I visited this section and I haven't noticed this link. IMHO this is a great opportunity for improvement. Nevertheless in general I find DirectAdmin extremely user friendly platform and I wish they continue their great job to make DA even better.
Screenshot 2025-05-17 120827.png
 
You have this link (see the image below) available for every domain,
Ah oke, so in Evo. I thought this was only to display the current values. I didn't know one could change the option there too as I don't use Evo. Odd that there is an edit option there if it will give an error anyway and won't change things.
Thank you for pointing it out. Indeed room for improvement there.

Looks like the connection is missing there @fln? Or why is the edit option present there if it not works?
 
Back
Top