soniktrooth Loading the site I was seeing 'deprecated function' errors and realised that I was running a much newer version of php than I should be for this site. So I deleted 8.1 and added 7.4, all very straight forward.

After that, though, it wouldn't serve the site, it would force download the index file instead. So I'm not sure where to go from there.

I have a theory about what might have happened here. When you configured the Nginx site, I'm assuming you would have specifically told it to use PHP 8.1. Then when you deleted the PHP 8.1 service from the rack, it was silently removed from the Nginx site configuration, leaving its PHP config set to "None". If you go back into the site config and set that to 7.4 I'm hoping you'll be in luck.

However, this definitely presents a usability issue. Many people may not initially even realise you can simultaneously run ALL the PHPs simultaneously in one stack if you really want, assigning any version to any site. So it's not like it can fall back to some default if a user deletes one that's in use.

The only solutions I can think of for when you delete a PHP that has been assigned to a site are:
a) Indigo places a warning triangle beside that site and won't start until its config has been re-saved, either with a new PHP version assigned, or "none" selected.
b) ask you to select a new PHP version from those already in your rack (or none) to replace the previous choice for all the sites that had that version chosen.

Neither are great, I fear:
a) has issues with sites being in a state where their PHP config is neither "none" nor a currently valid PHP option. The warning would indicate a problem, but visually the config would be fine.
b) assumes you've already added the new PHP version into your rack, which may not be the case.

Any thoughts on a better workflow around this?

Indigo changed the title to Problem after changing PHP versions .

Ahuh! Makes sense now. I skipped over the fact that I needed to set the php version in the config. You're right about it being problematic but I think I just wasn't thinking about the nature of this whole thing and looking at the settings properly.

It makes sense that you might want to run nginx without php so it wouldn't be an 'error' per se to not have one set. Maybe a more descriptive warning when removing a version of php that is in use by a site would be helpful. Something like: 'This version of php is currently in use by Site A and Site B. Are you sure you want to remove it?'
I think that would have helped me realise what was happening.

    soniktrooth more descriptive warning when removing a version of php that is in use by a site

    Thanks for your input! I've started implementing almost exactly the message as per above. I think it's the simplest to understand and also to implement 🙂 It should be in the next release.

    Powered by: FreeFlarum.
    (remove this footer)