I'm trying to deploy my first Symfony2 app.
Blank screen when trying to access it.
Checking the log:
$ sudo tail -f /var/log/apache2/error.log
[...] Uncaught exception 'RuntimeException' with message 'Failed to write cache file [...]
Trying to put the good rights on cache & logs
$ sudo chmod +a "www-data allow delete,write,[...]" app/cache app/logs
chmod: invalid mode: `+a'
Trying with setfacl
$ sudo setfacl -R -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs
setfacl: app/cache: Operation not supported
setfacl: app/logs: Operation not supported
I imagine my partition is not mounted with acl or something similar.
Couldn't I simply chown www-data cache & logs ?
To use setfacl, you first need to install acl utilities:
# Provided Apt can be used for package management
$ sudo apt-get install acl
Then remount the disk partition containing your symfony2 project:
# Remount the partition containing your Symfony2 application
# e.g. we could remount the root (/) partition
$ sudo mount -o remount,acl / #
# we could also remount the /var partition in our app lives in /var/www
$ sudo mount -o remount,acl /var #
http://symfony.com/doc/2.0/book/installation.html#configuration-and-setup https://help.ubuntu.com/community/FilePermissionsACLs
Since you're not supposed to develop on the deployment server, just give the whole app to the www-data
user:
sudo chown -R www-data:www-data /path/to/the/root/of/your/app
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With