gives an error when the Timezone is not set in php.ini:
[Tue Mar 28 14:04:32.836707 2017] [:error] [pid 7277:tid 140651110819584] [client 192.168.0.151:58982] PHP 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 <PATH>/dolibarr/core/lib/date.lib.php:129\nStack trace:\n#0 <PATH>/dolibarr/core/lib/date.lib.php(129): DateTime->__construct()\n#1 <PATH>/dolibarr/core/modules/modAdherent.class.php(333): dol_time_plus_duree(1490702672, 1, 'y')\n#2 <PATH>/dolibarr/core/lib/admin.lib.php(952): modAdherent->__construct(Object(DoliDBPgsql))\n#3 <PATH>/dolibarr/admin/dict.php(501): complete_dictionary_with_modules(Array, Array, Array, Array, Array, Array, Array, Array, Array, Array, Array, Array)\n#4 { in <PATH>/dolibarr/core/lib/date.lib.php on line 129, referer: https://<HOST>/dolibarr/admin/modules.php?mainmenu=home
While I am aware this is my fault for forgetting to set that on this box, maybe the error should be cought and that message displayed in the browser.
Also I reocmmend that maybe the install script checks if the timezone i set in php.ini so this doesn’t happen in the first place? (also during update of course)
I did the same. in php ini I have added date.timezone=“Asia/Dubai”
then I have created a php script in the root directory of my webserver with the following content. <?php
phpinfo();
?>
I named it phpinfo.php
then I called it throu the browsers and got correct valued=s from server.
I has able to fix the issue with the help of hosting provider’s support.
it appears that dolibarr is looking for php.ini in provider’s set directory, which for security reasons is not available for modification but ther’s a way to enable recursive php.ini.
what does that mean? just by typing something in htaccess file php starts looking for php.ini in all folders. This is a link
something to Dolibarr developers also.
before fixing with above method I checked with phpinfo() function and Dolibarr’s Admin Tools->about PHP menu.
both returned different values for Loaded Configuration File.
it seems to be a bug. and please implement timezone in Dolibarr per user rather than server’s whiting php.ini.