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 |
Reporter | MartinW | Assigned To | dregad | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
OS | Windows | OS Version | 7 | ||
Product Version | 1.3.4 | ||||
Target Version | 1.3.5 | Fixed in Version | 1.3.5 | ||
Summary | 0022011: LOG_ALL causes error | ||||
Description | Specifying the log_level to be "LOG_ALL" causes the following message and the system becomes blocked. "SYSTEM WARNING 'date(): 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 '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; | ||||
Additional Information | 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. | ||||
Attached Files | |||||
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 you're 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. I'm 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. <?php
$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. Thanks. |
|
Which version of PHP do you use? |
|
PHP V5.4.27 And this doesn't happen with Mantis Version 1.2.15 on the same machine. |
|
What's 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). That's 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 2016-12-06 01:37 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 application. 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 preferences. Fixes 0022011 |
Affected Issues 0022011 |
|
mod - core.php | Diff File |