Skip to content

Commit 14d2afb

Browse files
committed
feature #6136 Update directory permissions to make var/ writable (andrerom)
This PR was merged into the 3.0 branch. Discussion ---------- Update directory permissions to make var/ writable Simplifies the directory permission commands to make sure: - `var/sessions` folder is writable - other custom sub folders of `var` are writeable, typically data / storage / upload folder needed cms/crm/ecommerce/pim/.. systems built on top of symfony, avoiding that these projects needs to have own conflicting documentation on this Closes #6132 Commits ------- d6456ad Update dir permissions to reflect var being writable f18a1aa Update directory permissions to make var/ writable
2 parents c77773a + d6456ad commit 14d2afb

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

book/installation.rst

+9-10
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,10 @@ If there are any issues, correct them now before moving on.
227227

228228
.. sidebar:: Setting up Permissions
229229

230-
One common issue when installing Symfony is that the ``var/cache`` and
231-
``var/logs`` directories must be writable both by the web server and the
232-
command line user. On a UNIX system, if your web server user is different
233-
from your command line user, you can try one of the following solutions.
230+
One common issue when installing Symfony is that the ``var`` directory must
231+
be writable both by the web server and the command line user. On a UNIX
232+
system, if your web server user is different from your command line user
233+
who owns the files, you can try one of the following solutions.
234234

235235
**1. Use the same user for the CLI and the web server**
236236

@@ -249,12 +249,11 @@ If there are any issues, correct them now before moving on.
249249

250250
.. code-block:: bash
251251
252-
$ rm -rf var/cache/*
253-
$ rm -rf var/logs/*
252+
$ rm -rf var/cache/* var/logs/* var/sessions/*
254253
255254
$ 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`
256-
$ sudo chmod +a "$HTTPDUSER allow delete,write,append,file_inherit,directory_inherit" var/cache var/logs
257-
$ sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" var/cache var/logs
255+
$ sudo chmod +a "$HTTPDUSER allow delete,write,append,file_inherit,directory_inherit" var
256+
$ sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" var
258257
259258
260259
**3. Using ACL on a system that does not support chmod +a**
@@ -268,8 +267,8 @@ If there are any issues, correct them now before moving on.
268267
.. code-block:: bash
269268
270269
$ 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`
271-
$ sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX var/cache var/logs
272-
$ sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX var/cache var/logs
270+
$ sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX var
271+
$ sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX var
273272
274273
If this doesn't work, try adding ``-n`` option.
275274

0 commit comments

Comments
 (0)