php symfony2安装缓存权限
我已经下载了 2.0.4...由于权限问题,我无法通过“无法创建缓存目录”...
我尝试了 chmod 777 -R symfony -- 对于所有文件夹,仍然无法创建缓存目录
我已经尝试过 setfacl
但它说无法识别的 -m 选项.... 我的系统不支持 chmod +a
我已经完成了 chown -R myuser:apache symfony --
我在 console.php/app_dev.php/app.php
中仍然没有尝试过 umask(0000)
和 umask(0002)
-- 仍然没有
当我刷新页面到 http://localhost/symfony/web/app_dev.php
时,我收到 SElinux 警报...这是否导致了某些问题?我不确定...所有 symfony 内容都是单词可写的。
我不确定是不是我的问题……但这让我发疯,也许我应该停止使用 symfony2。
我正在使用 Fedora 13。
I've downloaded 2.0.4... I can't get pass the "can't create cache directory" cause of permissions problem...
I've tried chmod 777 -R symfony
-- to all folders, still can't create cache dir
I've tried setfacl
but it says unrecognized -m option....
My system does not support chmod +a
I've done chown -R myuser:apache symfony
-- still nothing
I've tried umask(0000)
and umask(0002)
in console.php/app_dev.php/app.php
-- still nothing
When I refresh the page to http://localhost/symfony/web/app_dev.php
, I get a SElinux alert... is this causing something? I'm not sure... all symfony content is word writable.
I'm not sure if it's me... but it's driving me nuts, maybe I just should stop using symfony2.
I'm using Fedora 13.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看来您需要将 SELinux 切换到 Permissive 状态。您可以以 root 用户身份执行此操作:
It seems that you will need to switch SELinux to Permissive state. You can do so executing as root user:
当默认的 apache umask 不同时,PHP 的 umask 可能不起作用。
最初我曾经使用setfact,但这增加了部署的开销。
在 ubuntu 服务器上对我有用的是:
编辑 /etc/apache2/envvars 并将此行添加到文件末尾:
重新加载apache服务
注销或重新启动服务器才能生效。
删除app/cache,app/logs目录
尝试在浏览器中加载页面,注意app/cache目录是如何由www-data用户创建的,并具有写组权限。尝试清除控制台中的缓存并验证没有发生错误。
删除app/cache、app/logs目录
运行cache:clear,注意app/cache目录是如何由用户部署用户创建的,并具有写组权限。尝试在浏览器中加载页面,并验证没有发生错误。
现在,您可以忘记此特定服务器上所有后续项目的缓存和日志权限。
PHP's umask may have no effect when default apache umask is different.
Originally I used to use setfact, but this adds overhead for deployment.
What worked for me on ubuntu servers is:
Edit /etc/apache2/envvars and add this line in the end of file:
Reload apache service
Logout or restart server for this to take effect.
Remove app/cache, app/logs dirs
Try to load page in browser, notice how app/cache dir is created by www-data user and has write group permission. Try to clear cache in console and verify that no errors occurred.
Remove app/cache, app/logs dirs
Run cache:clear, notice how app/cache dir is created by user deploy user and has write group permission. Try to load page in browser, and verify that no errors occurred.
Now you can forget about cache and logs permissions on this particular server for all subsequent projects.