I know that nginx sets the user for php as www-data. Therefore the user www-data needs access to the entire structure as described in this blog post.
To express my issues I will have to define some parameters:
- Lets define the php user as 'www'.
- Lets define a human user as 'mods'.
- Lets define a group called 'webaccess'.
- Both 1 and 2 are members of 3.
The idea here is that I want html directory and all sub file set to mods:webaccess 750 so that mods can upload and modify php files, and that, obviously, www can access and handle php requests.
The problem is that, with this setting I keep getting the "No input file specified." error. Now, since the www user is a member of webaccess, shouldn't they should be able to read the php files with the permissions of rx set for the group?
To verify that it is in fact a permissions issue and not a path issue, I added a php file in the web root containing <?php echo exec('whoami'); ?>
, with the permissions set to 750, I get the "No input file specified." error. So I change the permissions to 755 and then I get back the user 'www'.