As I understand, in a typical LAMP (or be it LEPP) setup, all PHP code is executed using the same user and group ("www" or similar). In a multi-user scenario (e.g. some variant of allowing Linux user accounts to propagate a
public_html directory with PHP code), wouldn't this pose a significant risk of users compromising other users' web space or other resources belonging to "www"?
Common advice seems to be to disable "dangerous" PHP functions (i.e. variants of
exec) and setting the PHP option
open_basedir to limit the files that can be accessed by PHP.
These measures, while comprehensible, don't seem to be reliable:
open_basedir bypasses are not considered to be security issues
Is it a viable alternative to run separate PHP instances per user (e.g., by creating separate php-fpm pools) to shift the responsibility of privilege separation to the Linux system?
In a production environment, such as a commercial web hosting service,
- What kind of setup can I expect to find?
- And why is it that while the former solution is widely advised, it seems difficult to find guidance online regarding the latter approach?