Merge pull request #1111 from baffo32/1110-fatal-unset-timezone
Fatal error if date.timezone is unset
This commit is contained in:
commit
ee96793fb3
5
INSTALL
5
INSTALL
|
@ -92,8 +92,9 @@ NOTE: The database server, database name, user and password can be different and
|
|||
7) Populate the zoneminder database using the script zm_create.sql. This should be found in <prefix>/share/zoneminder/db or in the project/db directory.
|
||||
|
||||
8) Create an apache virtual host for ZoneMinder. Make sure to use the same paths as ZM_WEBDIR and ZM_CGIDIR in /etc/zm.conf
|
||||
9) Create other config if desired (e.g. rsyslog, logrotate and such). Some of this can be found in <prefix>/share/zoneminder/misc or project/misc directory
|
||||
10) Setup an appropriate startup script for your system. Two generic startup scripts have been provided, a legacy Sys V Init script and a Systemd service file.
|
||||
9) Verify date.timezone is set to your timezone. This parameter is often found inside the system php.ini file. Consult your distribution's documentation for the proper way to set this value.
|
||||
10) Create other config if desired (e.g. rsyslog, logrotate and such). Some of this can be found in <prefix>/share/zoneminder/misc or project/misc directory
|
||||
11) Setup an appropriate startup script for your system. Two generic startup scripts have been provided, a legacy Sys V Init script and a Systemd service file.
|
||||
|
||||
*Sys V Init Setup*
|
||||
- Copy the sys v init script /scripts/zm from the build folder to /etc/init.
|
||||
|
|
|
@ -60,6 +60,12 @@ else
|
|||
define( "ZM_BASE_PROTOCOL", $protocol );
|
||||
define( "ZM_BASE_URL", $protocol.'://'.$_SERVER['HTTP_HOST'] );
|
||||
|
||||
// Check time zone is set
|
||||
if (!ini_get('date.timezone') || !date_default_timezone_set(ini_get('date.timezone'))) {
|
||||
date_default_timezone_set('UTC');
|
||||
Fatal( "ZoneMinder is not installed properly: php's date.timezone is not set to a valid timezone" );
|
||||
}
|
||||
|
||||
if ( isset($_GET['skin']) )
|
||||
$skin = $_GET['skin'];
|
||||
elseif ( isset($_COOKIE['zmSkin']) )
|
||||
|
|
Loading…
Reference in New Issue