View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0022011||mantisbt||bugtracker||public||2016-12-06 03:32||2016-12-30 19:11|
|Target Version||1.3.5||Fixed in Version||1.3.5|
|Summary||0022011: LOG_ALL causes error|
Specifying the log_level to be LOG_ALL causes the following message and the system becomes blocked.
date(): It is not safe to rely on the systems 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 D:\mantisbt-1.3.4\core\logging_api.php line 108
Please use the Back button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section.
|Steps To Reproduce|
Simply add the line:
$g_log_level = LOG_ALL;
to the config_inc.php file and access the site. The error appears but the user is unable to progress further. Pressing the Back button as suggested does nothing except display the same message. The option can be part of a group but still have the same problem. e.g.
$g_log_level = LOG_ALL & ~LOG_EMAIL & ~LOG_EMAIL_RECIPIENT;
Logging_api.php line 108 also has no bearing on this error either as it is:
Also setting other logging levels, such as
do not cause this problem.
|Tags||No tags attached.|
mantis1.jpg (307,872 bytes)
Did you follow the installation guide and run admin/check/index.php after finishing the installation?
If so, did you get any error or warnings, especially concerning timezone settings?
As the message says, it is required to set the timezone in your MantisBT / PHP environment.
This can be done in php.ini, or in your MantisBT config_inc.php file ($g_default_timezone).
This is most likely because no log events of this kind have been triggered on the page youre trying to load.
This is not a bug or feature request for MantisBT (you are asking for help on how to configure the system). I am therefore resolving this issue as no change required.
Please use the forums, the mantisbt-help mailing list or IRC to get support on customizing and using MantisBT (see http://www.mantisbt.org/support.php)
Sorry but I did set the time zone as requested to something, specifically:
And I did run admin/check/index.php - twice - as I got the error originally about timezones.
Im not asking for help to configure the system - simply stating a fact that if you add the LOG_ALL option to the config_inc.php file, the system fails. This is all I have in the config_inc.php file.
$g_default_timezone = Europe/London;
$g_crypto_master_salt = kSzCPy4jnkpkOCtxEadN1mSuI7hblb58Z0shqqiNgZg=;
$g_log_level = LOG_ALL;
and this fails. Removing the last line allows me to login in, otherwise I get the error message.
Which version of PHP do you use?
And this doesnt happen with Mantis Version 1.2.15 on the same machine.
Whats the setting of date.timezone in your php.ini?
OK, I see what the problem is and can reproduce it.
core.php initializes the timezone from config_inc.php, but this happens only after including several APIs.
Specifically, the issue is with plugin initializations executing DB queries; db_query() attempts to log the query (LOG_DATABASE in database_api.php:447).
Thats fairly easy to fix.
That being said, you really should set the timezone globally at PHP level (i.e. set date.timezone in php.ini)
I understand what you’re saying and thought it was probably something like the order of initialisation items. Will update php.ini to include the correct one.
Many thanks for taking the time and perseverance to respond!
MantisBT: master-1.3.x 1093aa11
Committer: vboctor Details Diff
|Initialize timezone early
log_event() uses date(), which triggers a PHP notice when the default
timezone has not been set in php.ini (date.timezone) or by the
Since core.php initializes the timezone only after including several
APIs, depending on log and error level settings in config_inc.php, this
can prevent MantisBT from operating properly.
To prevent this problem, we now set the default timezone as early as we
can, and change it later if necessary according to the user's
|mod - core.php||Diff File|
|2016-12-06 03:32||MartinW||New Issue|
|2016-12-06 03:32||MartinW||File Added: mantis1.jpg|
|2016-12-06 04:07||atrol||Status||new => feedback|
|2016-12-06 04:07||atrol||Note Added: 0054687|
|2016-12-06 04:07||atrol||Priority||high => normal|
|2016-12-06 04:07||atrol||Severity||block => minor|
|2016-12-06 04:37||dregad||Assigned To||=> dregad|
|2016-12-06 04:37||dregad||Status||feedback => resolved|
|2016-12-06 04:37||dregad||Resolution||open => no change required|
|2016-12-06 04:37||dregad||Note Added: 0054688|
|2016-12-06 05:28||MartinW||Note Added: 0054689|
|2016-12-06 05:41||atrol||Assigned To||dregad =>|
|2016-12-06 05:41||atrol||Status||resolved => feedback|
|2016-12-06 05:41||atrol||Resolution||no change required => reopened|
|2016-12-06 05:41||atrol||Note Added: 0054691|
|2016-12-06 05:55||MartinW||Note Added: 0054692|
|2016-12-06 05:55||MartinW||Status||feedback => new|
|2016-12-06 06:17||atrol||Status||new => feedback|
|2016-12-06 06:17||atrol||Note Added: 0054694|
|2016-12-06 06:21||dregad||Assigned To||=> dregad|
|2016-12-06 06:21||dregad||Status||feedback => assigned|
|2016-12-06 06:21||dregad||Note Added: 0054695|
|2016-12-06 06:43||dregad||Target Version||=> 1.3.5|
|2016-12-06 06:43||dregad||Note Added: 0054697|
|2016-12-07 03:29||MartinW||Note Added: 0054709|
|2016-12-11 23:12||vboctor||Changeset attached||=> MantisBT master-1.3.x 1093aa11|
|2016-12-11 23:12||vboctor||Assigned To||dregad => vboctor|
|2016-12-11 23:12||vboctor||Status||assigned => resolved|
|2016-12-11 23:12||vboctor||Fixed in Version||=> 1.3.5|
|2016-12-12 01:21||vboctor||Assigned To||vboctor => dregad|
|2016-12-30 15:54||vboctor||Status||resolved => closed|
|2016-12-30 19:11||dregad||Resolution||reopened => fixed|