I cannot find a working, modern configuration to resolve this. I'm using Debian 10 and installed Apache 2. I have dozens of users, so I enabled userdir. I do not want their code to run as www-data, so I enabled suexec, which works for Python or Perl (AddHandler cgi-script .pl .py is enough). But I cannot do this for PHP. Is therer a way to handle this with standard mod_php from Apache, suexec-like with userdir?
If no, I read that PHP FPM is a CGI server, which can be used by Apache by proxy module, which can proxy PHP to this CGI, but in the php-fpm.conf I only cat set single user for this.
Is there a way to run PHP web script as a user that owns the scritp, like suexec is doing, together with userdir?