Found a discussion having the same problem back in 2021 and turned out I have to set the php-fpm service ProtectHome to false (which you answer to someone else’s question) thank you and I can finally start to do webdev on nixos again
Edit: oh, BTW this is the discussion