如何在找不到文件时设置权限? Symfony的

时间:2013-08-16 04:16:35

标签: php symfony frameworks installation

我在安装Symfony时遇到了很多麻烦:我将.zip文件安装到XAMPP中的htdocs文件夹中,根据Symfony的配置文件,我需要重置权限:

  1. 更改“app / cache /”目录的权限,以便Web服务器可以写入。
  2. 更改“app / logs /”目录的权限,以便Web服务器可以写入该目录。 我去了这里:http://symfony.com/doc/current/book/installation.html并尝试了第1步,重置终端中的权限,它告诉我:
  3. chmod:无法在文件'app / cache'上设置ACL:没有这样的文件或目录 chmod:无法在文件'app / logs'上设置ACL:没有这样的文件或目录

    所以我尝试了第2步和第3步。我在我的本地机器上找到/app_dev.php/,它仍然告诉我“找不到对象” 我不知道该做什么。在此先感谢您的帮助。

1 个答案:

答案 0 :(得分:1)

尝试:

$ rm -rf app/cache/*
$ rm -rf app/logs/*

设置权限

$ APACHEUSER=`ps aux | grep -E '[a]pache|[h]ttpd' | 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

OR

$ APACHEUSER=`ps aux | grep -E '[a]pache|[h]ttpd' | grep -v root | head -1 | cut -d\  -f1`
$ sudo setfacl -R -m u:$APACHEUSER:rwX -m u:`whoami`:rwX app/cache app/logs
$ sudo setfacl -dR -m u:$APACHEUSER:rwX -m u:`whoami`:rwX app/cache app/logs