What is the most common server permission policy for web application deployment?
According to the Nginx docs you can configure the user which runs Nginx. By default the user is nobody.

You can read this Ask Ubuntu question that explains how to configure Apache2 to run as a different user. The default user running Apache2 is www-data.

A common strategy, and one I think may work for your goal, is to assign the users that need to deploy the application to a common group. For instance, if you added them to the www-data group:

sudo adduser &lt;user&gt; www-data


You can see which groups is a member of with:

groups &lt;user&gt;


Then change the group of the directory where users will run migrate.php:

sudo chgrp -R www-data /var/www/demoapp


Then assign the group read/write/execute permissions to the directory:

sudo chmod -R g+rwx /var/www/demoapp/


The users in this group should now be able to write and run scripts within the demoapp/ directory.