Symfony2 - 部署缓存没有setfacl

Pie*_*NAY 8 deployment debugging caching symfony

我正在尝试部署我的第一个Symfony2应用程序.

尝试访问时出现空白屏幕.

检查日志:

$ sudo tail -f /var/log/apache2/error.log
Run Code Online (Sandbox Code Playgroud)

[...]未捕获的异常'RuntimeException',消息'无法写入缓存文件[...]

试图将好的权利放在缓存和日志上

$ sudo chmod +a "www-data allow delete,write,[...]" app/cache app/logs
Run Code Online (Sandbox Code Playgroud)

chmod:无效模式:`+ a'

尝试使用setfacl

$ sudo setfacl -R -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs
Run Code Online (Sandbox Code Playgroud)

setfacl:app/cache:不支持操作
setfacl:app/logs:不支持操作

我想我的分区没有安装acl或类似的东西.

难道我不能简单地chown www-data cache&logs?

Thi*_*nne 10

要使用setfacl,首先需要安装acl实用程序:

# Provided Apt can be used for package management
$ sudo apt-get install acl
Run Code Online (Sandbox Code Playgroud)

然后重新安装包含symfony2项目的磁盘分区:

# 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  # 
Run Code Online (Sandbox Code Playgroud)

http://symfony.com/doc/2.0/book/installation.html#configuration-and-setup https://help.ubuntu.com/community/FilePermissionsACLs

  • [本文档](https://help.ubuntu.com/community/FilePermissionsACLs)(对于Ubuntu)帮助我了解如何使用ACL (2认同)

Eln*_*mov 6

由于您不应该在部署服务器上进行开发,只需将整个应用程序提供给www-data用户:

sudo chown -R www-data:www-data /path/to/the/root/of/your/app
Run Code Online (Sandbox Code Playgroud)