If you get following error message:

Fatal error
: Uncaught exception 'Exception' with message '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 the timezone 'UTC' for now, but please set date.timezone to select your timezone.' in [...] :0 Stack trace: #0 [...]: DateTime->__construct() #1 [...] {main} Next exception 'Exception' with message '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 us in [...] on line 0

It's wasted time try to debug your php code, which probably is right.

The issue is that in your php.ini the system variable date.timezone is not set (you can verify running phpinfo(): almost surely you'll find that date.timezone is set to "no value".

How to fix:
Set date.timezone to a value according to your system. You can do it globally (acting on php.ini) or locally (acting to .htaccess)

Using .htaccess: you need insert a line of code as follows:

php_value date.timezone "Europe/Vienna"

Allowed values for date.timezone are listed here: http://www.php.net/manual/en/timezones.php



Found this article interesting?
Subscribe to DomainRegister´s newsletter!

You can unsubscribe at any time by simply clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.

We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp s privacy practices here.

  • php
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

 How to set php.ini values using .htaccess

You can override global values of system variables re-setting them in .htaccessFor each system...

 PHP Parse error: syntax error, unexpected $end

This is a very common error, typically caused by a missing } used in PHP to denote content...

 How to send mails through your website

On shared web hosting server for security reasons it's not possible unauthenticated email sending...

 allow_url_fopen

If enabled, allow_url_fopen allows PHP's file functions (such as file_get_contents() and the...

 Limiti funzione php mail()

per motivi di sicurezza sui nostri server di hosting shared Linux la funzione php mail() è...