Persist with the chosen PHP version.

elsevi

Verified User
Joined
Jan 27, 2020
Messages
38
How do you make the chosen PHP version stick based on your selection rather than the slot you picked? The problem is that if a user selects slot 1, which is PHP 8.4, and later switches to PHP 8.5, their application might not be compatible and would give an error. How can we make the version information persist by version instead of by slot and avoid this recurring issue?

Thanks
 
Hello,

There is no automation for this. You will need to address it manually through modifying php1_select= option in every /usr/local/directadmin/data/users/*/domains/*.conf file.



How can we make the version information persist by version instead of by slot and avoid this recurring issue?
 
I completely understand, but unfortunately, I have to say that this is not practical.

The issue is that we are constantly adding new PHP versions because the security ecosystem itself requires us to do so. In practice, this means adding the new versions to additional slots.

However, we have encountered situations on some of our servers where the primary PHP version slot has become obsolete, preventing Roundcube from being updated.

This raises several important concerns that I believe should be addressed. For example, if I have multiple slots with different PHP versions and later change the PHP version assigned to one of those slots, that change directly affects all users who are using it.

For this reason, the PHP version selected by each user should persist independently of any subsequent changes made to the slot itself. I believe this is an important issue that the DirectAdmin developers should investigate thoroughly.
 
The issue is that we are constantly adding new PHP versions because the security ecosystem itself requires us to do so. In practice, this means adding the new versions to additional slots.
If you want an old version to persist then you could add it to an higher slot number and keep it there.

But I know what you mean. Kindlike how CP has it. You can choose there that a PHP version will be inherited or not. If not, then it will automatically kept if the main server PHP version will change, provided that the choice for multiple PHP options is present.

Like @zEitEr explained DA does not have such inherited on/off function but another config method.
You could suggest such feature request in the Directadmin Feedback site (click). You need a seperate login for that.

Personally I always look with the php versions list (extended) plugin which users have which php version.
Then I implement the new php version and at the same time set the older php version to option 2.
After completing I move all users which have php version 1 to php version 2 and then afterwards they can select to change it to the newer version themselves and things keep working.

You might want to check this thread (click) for it, but there are more. Or write a script for it as already suggested.

Personally we always put a new php version as last for example option 4. Then users can test for a couple of weeks and upgrade their stuff. After that we set it to option 1 and put all or most users to it, except the few who do not have option 4 then, they need to be moved seperately.

It's a bit of work, but it's 1 method. Most likely there are others, maybe better methods.
 
Back
Top