JAVIER MARTINEZ

Web Developer

“Unable to create the cache directory” error in Symphony2

One common issue in Symfony2 projects is bad directory permission settings. The “app/cache” and “app/logs” directories are the only who writes Symfony2.

Change “_www” to the web server user and “javierms” to your command line user:

$ rm -rf app/cache/*
$ rm -rf app/logs/*
$ sudo chmod +a “_www allow delete,write,append,file_inherit,directory_inherit” app/cache app/logs
$ sudo chmod +a “javierms allow delete,write,append,file_inherit,directory_inherit” app/cache app/logs

1 Comentario

  1. This can be done also. Thanks for your post.

    APACHEUSER=`ps aux | grep -E ‘[a]pache|[h]ttpd|[_]www|[w]ww-data’ | grep -v root | head -1 | cut -d\ -f1`

    sudo chmod +a “$APACHEUSER allow delete,write,append,file_inherit,directory_inherit” app/cache app/logs

    sudo chmod +a “`whoami` allow delete,write,append,file_inherit,directory_inherit” app/cache app/logs

Deja un comentario

Tu dirección de correo electrónico no será publicada.

*


*

© 2017 JAVIER MARTINEZ

Tema por Anders NorenArriba ↑