Might be worth migrating your php apps to containerized builds to help avoid this issue
You can probably mount the same data into the container, depending on the apps configuration
Doesn’t help if you build a nix flake based app yourself though, but with that you can manually pin a build.