Symfony2 Composer安装 [英] Symfony2 Composer Install
问题描述
我试图安装Symfony 2.1.3(最新)。我正在运行作曲家,安装一切正常。我得到的只有错误是:
脚本Sensio\Bundle \DistributionBundle \Composer \ ScriptHandler :: clearCache
处理使用异常终止的post-install-cmd事件
[RuntimeException]
执行cache:clear - no-warmup命令。
正在www文件夹下安装。我运行nginx并遵循作曲家的方法。我在互联网上阅读apache应该手动运行不作为服务,但我使用nginx代替。 apache还有什么影响吗?我使用debian挤压。
编辑:根据AdrienBrault的建议,错误是因为时区没有在php.ini中设置。只有--verbose我可以看到警告。非常感谢。
Apache不相关 - 通过命令行调用PHP。
最有可能的是缓存文件夹中的权限:您检查了运行composer更新的用户是否可以实际写入缓存文件夹?
尝试手动运行 rm -Rf app / cache / dev
(对于生产环境使用prod替换dev),并查看是否收到任何权限错误。
如果在CLI中运行时未在php中配置 default.timezone
设置,您将收到此错误。要验证只是运行
php --info | grep timezone
并检查是否已正确配置 date.timezone
/ p>
在安全方面,将777设置为文件夹不是最佳解决方案 - 如果您启用了ACL,您可以使用它来正确设置缓存和日志的权限夹。详情请参阅 Symfony2官方安装页面
I am trying to install Symfony 2.1.3 (latest). I am running composer and installs everything okay. The only error that I get is:
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
handling the post-install-cmd event terminated with an exception
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command.
It's being installed under www folder. I am running nginx and followed the composer approach. I read on internet that apache should be run manually not as a service, however I am using nginx instead. Does apache still have any bearing on it? I'm using debian squeeze.
Edit: As per AdrienBrault's suggestion the error was because the timezone was not set in the php.ini. Only with --verbose I could see the warning. Thanks guys.
Apache is not related - PHP is called via command line.
Most likely is the permission in the cache folder: did you check if the user that runs the composer update can actually write the cache folder?
Try to manually run rm -Rf app/cache/dev
(for production environment replace dev with prod) and see if you get any permission error.
Also you will get this error if the default.timezone
setting is not configured in php when running in CLI. To verify just run
php --info | grep timezone
and check that the setting date.timezone
is correctly configured.
On the security side, setting 777 to the folder is not the optimal solution - if you have ACL enabled you could use that to correctly set up the permission for the cache and logs folder. Read more at the Symfony2 official installation page
这篇关于Symfony2 Composer安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!