Composer "Create-Project" symfony2 错误

Composer "Create-Project" Error with symfony2

我正在通过此命令使用 composer 创建一个 symfony 项目 sudo composer create-project symfony/framework-standard-edition starwarsevents @stable 一切似乎都很顺利,直到我在所有配置选项中按下 enter,并遇到了这一系列错误

[Symfony\Component\Debug\Exception\ContextErrorException]

 Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.  

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.

但是,当我导航到我的项目文件夹时,所有必需的文件似乎都在那里。

我在想
1. 忽略此消息的后果是什么?
2. 我将如何解决这个问题?
3. 这些错误都相关吗?

我想这些错误是相关的。这是许多应用程序所需的标准 date.timezone 设置。

如何设置you can find here.

此外,项目已安装,因为这些是更新后的脚本(请参阅您的 composer.json)。这是两个独立的过程。此特定错误 (cache:clear --no-warmup) 表示未删除旧缓存。

这只是一个经典错误。如果您是 Linux 用户,请执行以下操作:(您可能没有全部三个,这是正常的)

sudo nano /etc/php5/apache2/php.ini
sudo nano /etc/php5/cli/php.ini
sudo nano /etc/php5/fpm/php.ini

类似下面的内容:

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Europe/London

重新启动您的 apache 后,应该没问题。