Symfony2, First Installation Warning message


Whoops, looks like something went wrong.

ErrorException: 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. in /var/www/html/symfony2/vendor/monolog/monolog/src/Monolog/Logger.php line 112

lets check the config.php to make sure that what is going on.  mine is http://test.lab/config.php  (I’m currently using virtual host to runs  Symfony on my Fedora 17) .

okay now from http://symfony2.lab/config.php give me more information about the warning, mine result PHP warning messages like this :

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. in /var/www/html/symfony2/app/SymfonyRequirements.php on line 434

PHP warns that the timezone is not set yet, let fix it…

gedit /etc/php.ini

then define the specific timezone using date.timezone = “Asia/Jakarta”

restart the web server using service httpd restart

refresh the browser and the warning messages become disappear.

for addition configuration, Symfony2 also recommend user to set app/cache and app/logs folder readable

chmod -R 777 app/cache/ app/logs/

Ok, now we have already done, go back to check the configuration  at  http://test.lab/config.php,

is everything ok right now?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s