【问题标题】:Composer "Create-Project" Error with symfony2symfony2 的作曲家“创建项目”错误
【发布时间】:2015-12-24 14:08:08
【问题描述】:

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

[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. 所有这些错误都相关吗?

【问题讨论】:

    标签: php symfony dependencies composer-php development-environment


    【解决方案1】:

    这只是一个典型的错误。如果您是 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 后,应该没问题。

    【讨论】:

      【解决方案2】:

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

      如何设置you can find here.

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-05-21
        • 1970-01-01
        • 1970-01-01
        • 2016-01-27
        • 2018-10-29
        • 2019-01-16
        • 2014-11-10
        • 2017-01-07
        相关资源
        最近更新 更多