Skip to content

Instantly share code, notes, and snippets.

@mjavadhpour
Last active October 23, 2017 06:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjavadhpour/97a91ad5e59f26f83afb2d619b118acb to your computer and use it in GitHub Desktop.
Save mjavadhpour/97a91ad5e59f26f83afb2d619b118acb to your computer and use it in GitHub Desktop.

PhpStorm should use the same permissions as the user that runs/ launches the script (yourself). Add yourself to the www-data group, or set up a new group.

Let's say you created a new group called "www-pub" and added yourself to it as per instructions.

Remember to log out and back in to have the new group membership take effect. Test your group membership with the groups command.

Then, change permissions of the /var/www directory as follows:

$ chown -R :www-pub /var/www

Set the group of all files in /var/www to "www-pub" recursively

$ chmod -R o+r /var/www

Allows everyone (including apache) to read all files in /var/www

$ chmod -R g+w /var/www

Allows group members to write to all files in /var/www

$ find /var/www -type d -exec chmod g+s {} \;

sets new files to retain the group of the directory they are created in If you need apache to also be able to write files (or read files without giving read to everyone else), add apache's user (usually "www-data") to the "www-pub" group.

Also, in PhpStorm's Deployment Options, make sure "override default permissions on (files/ directories)" are either unchecked or set to allow writing by group.

This process should also work for IntelliJ IDEA/ Webstorm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment