Luke
Luke

Reputation: 1830

Composer "Create-Project" Error with symfony2

I was creating a symfony project using composer with this command sudo composer create-project symfony/framework-standard-edition starwarsevents @stable and everything seemed to go fine, until I pressed enter through all the config options, and was met with this series of errors

[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.

However, when I navigate to my project folder, all the necessary files seem to be there.

I'm wondering
1. What are the consequences of ignoring this message?
2. How would I go about fixing this?
3. Are all these errors related?

Upvotes: 0

Views: 311

Answers (2)

BentCoder
BentCoder

Reputation: 12740

It is just a classic error. If you're a Linux user do these: (you might not have all three which is normal)

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

With something like below:

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

After restating your apache, it should be fine.

Upvotes: 1

Tomas Votruba
Tomas Votruba

Reputation: 24280

I suppose these errors are related. It's standard date.timezone setup required by lots of applications.

How to set it you can find here.

Also, project gets installed, because these are script after update (see your composer.json). These are two separated processes. This particular error (cache:clear --no-warmup) means old cache was not removed.

Upvotes: 0

Related Questions