MAMP Won't Work With Doctrine, Please Help.

Installation and environment issues, mainly on 1.x but there's some 2.x here too.

MAMP Won't Work With Doctrine, Please Help.

Postby zsherman » Sun Jun 12, 2011 8:18 am

I've created a bundle for a login system that I'm attempting to build which includes the appropriate controllers and entities. The login works with built in users but when I try to use the "php app/console doctrine:schema:update --force" command to set up my tables in MySQL I get this error:

"DateTime::__construct(): 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 'America/Chicago' for 'CDT/-5.0/DST' instead"

I already tried editing the php.ini file in MAMP to set the date/time but I still keep getting the same error. I even tried turning E_ALL in error reporting to E_ERRORS but again, it still repeats the error.

This is really halting my ability to do anything in Symfony 2 and I would really appreciate some help. Thanks.
zsherman
Junior Member
 
Posts: 2
Joined: Sun Jun 12, 2011 7:16 am

Re: MAMP Won't Work With Doctrine, Please Help.

Postby zsherman » Mon Jun 13, 2011 10:02 am

zsherman
Junior Member
 
Posts: 2
Joined: Sun Jun 12, 2011 7:16 am

Re: MAMP Won't Work With Doctrine, Please Help.

Postby harvestmedia » Fri Jan 20, 2012 9:12 pm

That solution doesn't show up anymore, Here's one that worked for me:

If you are working on Symfony 2 with Doctrine and getting stuck on “php app/console doctrine:schema:create” or (update) with this error…

DateTime::__construct(): 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 'America/Chicago' for 'CDT/-5.0/DST' instead


If you are using MAMP, just modify MAMP’s php.ini file is not enough to fix this error because when you execute php on the terminal, it uses the php from Mac OSX, not the one that came with MAMP.

So, the solution is to create new php.ini file in /private/etc directory with this content inside.

Code: Select all
date.timezone = "UTC"


This will do the trick!
harvestmedia
Junior Member
 
Posts: 4
Joined: Mon Jan 16, 2012 3:40 pm


Return to Installation and setup

Who is online

Users browsing this forum: Bing [Bot] and 1 guest