Once symfony installer installed
1 2 |
# Linux, Mac OS X $ symfony new project_name |
After doing this; new project will be created with fresh download from source.
Change directory to project folder, change 2 permission of 'log' and 'cache'
1 2 |
$ chmod 777 app/cache $ chmod 777 app/logs |
Run Symfony2's server with
1 |
$ php app/console server:run |
If everything is OK, you'll see...
1 2 3 |
Server running on http://127.0.0.1:8000 Quit the server with CONTROL-C. |
In case of date.timezone setting problem like above;
[themify_box style="red rounded warning" ] 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.[/themify_box]
First method (recommended): Edit system's php.ini (not the MAMP's one) by this terminal command.
1 |
$ nano /etc/php.ini |
Find "date.timezone" setting with Ctrl+W. Edit the empty setting above
1 |
;date.timezone = |
with..
1 |
date.timezone = "Europe/London" |
(or whatever "Europe/Berlin" etc.)
Second method (you should do for each project): Add this function into AppKernel.php
1 2 3 4 5 6 |
// project_name/app/AppKernel.php public function init() { date_default_timezone_set( 'Europe/London' ); parent::init(); } |