Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update directory permissions to make var/ writable #6136

Merged
merged 2 commits into from
Jan 16, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions book/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ If there are any issues, correct them now before moving on.

.. sidebar:: Setting up Permissions

One common issue when installing Symfony is that the ``var/cache`` and
``var/logs`` directories must be writable both by the web server and the
command line user. On a UNIX system, if your web server user is different
One common issue when installing Symfony is that the ``var/cache``, ``var/logs``
and ``var/sessions`` directories must be writable both by the web server and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just say /var here (as it is its semantic)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in d6456ad

the command line user. On a UNIX system, if your web server user is different
from your command line user, you can try one of the following solutions.

**1. Use the same user for the CLI and the web server**
Expand All @@ -242,12 +242,11 @@ If there are any issues, correct them now before moving on.

.. code-block:: bash

$ rm -rf var/cache/*
$ rm -rf var/logs/*
$ rm -rf var/cache/* var/logs/* var/sessions/*

$ HTTPDUSER=`ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1`
$ sudo chmod +a "$HTTPDUSER allow delete,write,append,file_inherit,directory_inherit" var/cache var/logs
$ sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" var/cache var/logs
$ sudo chmod +a "$HTTPDUSER allow delete,write,append,file_inherit,directory_inherit" var
$ sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" var


**3. Using ACL on a system that does not support chmod +a**
Expand All @@ -261,8 +260,8 @@ If there are any issues, correct them now before moving on.
.. code-block:: bash

$ HTTPDUSER=`ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1`
$ sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX var/cache var/logs
$ sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX var/cache var/logs
$ sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX var
$ sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX var

If this doesn't work, try adding ``-n`` option.

Expand Down