I am trying to configure a Symfony 2.7 application on a shared server and does not have permission to modify php.ini without permission .
Run: php app/console doctrine:schema:drop --force
Displays these warnings / errors:
PHP Warning: Uncaught exception 'Symfony\Component\Debug\Exception\ContextErrorException' with message 'Warning: date_default_timezone_get(): It is not safe to rely on the system 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.' 0 [internal function]: Symfony\Component\Debug\ErrorHandler- >handleError(2, 'date_default_ti...', '/path...', 272, Array) 1 /domain.com/app/vendor/monolog/monolog/src/Monolog/Logger.php(272): date_default_timezone_get() 2 /domain.com/app/vendor/monolog/monolog/src/Monolog/Logger.php(481): Monolog\Logger->addRecord(100, 'Notified event ...', Array) 3 /domain.com/app/vendor/symfony/ in /domain.com/app/vendor/monolog/monolog/src/Monolog/Logger.php on line 272 PHP Fatal error: date_default_timezone_get(): Timezone database is corrupt - this should *never* happen! in /domain.com/app/vendor/monolog/monolog/src/Monolog/Logger.php on line 272 PHP Warning: date_default_timezone_get(): It is not safe to rely on the system 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 /domain.com/app/vendor/monolog/monolog/src/Monolog/Logger.php on line 272 PHP Fatal error: date_default_timezone_get(): Timezone database is corrupt - this should *never* happen! in /domain.com
I tried this :
class AppKernel extends Kernel { public function init() { date_default_timezone_set( 'Europe/Berlin' ); parent::init(); } }
It displays the following error:
PHP Fatal error: Uncaught exception 'Symfony\Component\Debug\Exception\ContextErrorException' with message 'Notice: date_default_timezone_set(): Timezone ID 'Europe/Berlin' is invalid' in /domain.com/app/app/AppKernel.php:42
According to php.net Europe/Berlin is a valid identifier.
According to this answer timezonedb.so should be installed (it is not).
According to the Symfony 1.4 docs, you can set default_timezone in settings.yml . I can not find a similar configuration for >= 2.0 . Edit : "Unlike Symfony 1.4, there is no default_timezone configuration parameter to set the default time zone in Symfony2. [...]" ( source )
Any ideas how to solve the problem?
Thanks in advance!
Mr. B. source share