zoneminder wont start since upgrade to 22.04
have run zoneminder on ubuntu for4 years, when i upgraded my home server ot ubuntu 22.04 last month, after diligent search and trying to repair zoneminder so as not to lose the setup i had worked with for so long, I reinstalled zoneminder and when i point my system to instead of the console that normally comes up I get this:
<?php
//
// ZoneMinder main web interface file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
error_reporting
$debug = false;
if ( $debug ) {
// Use these for debugging, though not both at once!
phpinfo(
}
// Use new style autoglobals where possible
if ( version_
$_SESSION = &$HTTP_
$_SERVER = &$HTTP_SERVER_VARS;
}
// Useful debugging lines for mobile devices
if ( false ) {
ob_start();
phpinfo(
$fp = fopen('
fwrite($fp, ob_get_contents());
fclose($fp);
ob_end_clean();
}
require_
require_
require_
require_
// Useful debugging lines for mobile devices
if ( 0 and ZM\Logger:
ob_start();
phpinfo(
ZM\Debug(
ob_end_clean();
}
global $Servers;
$Servers = ZM\Server::find();
if (
(isset(
or
(isset(
) {
$protocol = 'https';
} else {
$protocol = 'http';
}
define(
// Absolute URL's are unnecessary and break compatibility with reverse proxies
// define( "ZM_BASE_URL", $protocol.
// Use relative URL's instead
define(
require_
if ( $_SERVER[
ZM\Debug('OPTIONS Method, only doing CORS');
# Add Cross domain access headers
CORSHeaders();
return;
}
if ( isset($
$skin = $_GET['skin'];
} else if ( isset($
$skin = $_COOKIE['zmSkin'];
} else if ( defined(
$skin = ZM_SKIN_DEFAULT;
} else {
$skin = 'classic';
}
if (!is_dir(
$skins = array_map(
if ( !in_array($skin, $skins) ) {
ZM\
$skin = $skins[0];
}
}
global $css;
if ( isset($_GET['css']) ) {
$css = $_GET['css'];
} else if ( isset($
$css = $_COOKIE['zmCSS'];
} else if ( defined(
$css = ZM_CSS_DEFAULT;
} else {
$css = 'classic';
}
if (!is_dir(
$css_skins = array_map(
if (count($css_skins)) {
if (!in_array($css, $css_skins)) {
ZM\
$css = $css_skins[0];
} else {
$css = '';
}
} else {
ZM\Error("No css options found at skins/$skin/css");
$css = '';
}
}
define(
define(
define(
$skinBase = array(); // To allow for inheritance of skins
if (!file_
ZM\Fatal("Invalid skin '$skin'");
$skinBase[] = $skin;
zm_session_start();
if (
!isset(
isset(
!isset(
($_COOKIE[
) {
$_SESSION['skin'] = $skin;
zm_setcookie(
}
if (
!isset(
isset(
!isset(
($_COOKIE[
) {
$_SESSION['css'] = $css;
zm_setcookie(
}
# Add Cross domain access headers
CORSHeaders();
// Check for valid content dirs
if ( !is_writable(
ZM\Warning(
}
# Globals
# Running is global but only do the daemonCheck if it is actually needed
$running = null;
$action = null;
$error_message = null;
$redirect = null;
$view = isset($
$user = null;
$request = isset($
require_
# Only one request can open the session file at a time, so let's close the session here to improve concurrency.
# Any file/page that sets session variables must re-open it.
session_
require_
require_
require_
require_
// lang references $user[Language] so must come after auth
require_
foreach ( getSkinIncludes
require_once $includeFile;
}
if (isset(
# Actions can only be performed on POST because we don't check csrf on GETs.
$action = detaintPath(
} else if (isset(
ZM\Error('actions can no longer be performed without POST. Requested: '.$_REQUEST[
}
# The only variable we really need to set is action. The others are informal.
isset($view) || $view = NULL;
isset($request) || $request = NULL;
isset($action) || $action = NULL;
if ( (!$view and !$request) or ($view == 'console') ) {
check_timezone();
}
ZM\Debug("View: $view Request: $request Action: $action User: " . ( isset($user) ? $user['Username'] : 'none' ));
if (
ZM_ENABLE_
( $action != 'login' ) &&
( $view != 'view_video' ) && // only video no html
( $view != 'image' ) && // view=image doesn't return html, just image data.
( $request != 'control' ) &&
//( $view != 'frames' ) && // big html can overflow ob
( $view != 'archive' ) // returns data
&& ( (!isset(
) {
require_
#ZM\Debug(
csrf_check();
}
# If I put this here, it protects all views and popups, but it has to go after actions.php because actions.php does the actual logging in.
if ( ZM_OPT_USE_AUTH and (!isset($user)) and ($view != 'login') and ($view != 'none') ) {
if ($request) {
# requests only return json
header(
exit;
}
$view = 'none';
$redirect = ZM_BASE_
zm_session_
$_SESSION[
session_
} else if ( ZM_SHOW_PRIVACY && ($view != 'privacy') && ($view != 'options') && (!$request) && canEdit('System') ) {
$view = 'none';
$redirect = ZM_BASE_
$request = null;
}
# Need to include actions because it does auth
if ( $action and $view and !$request ) {
if ( file_exists(
require_
} else {
ZM\Debug("No includes/
}
}
if ( isset($
$redirect = '?view=
}
if ($redirect) {
ZM\Debug(
header('Location: '.$redirect);
return;
}
if ( $request ) {
foreach ( getSkinIncludes
if ( !file_exists(
ZM\
require_once $includeFile;
}
return;
}
# Add CSP Headers
$cspNonce = bin2hex(
if ( $includeFiles = getSkinIncludes
ob_start();
CSPHeaders($view, $cspNonce);
foreach ( $includeFiles as $includeFile ) {
if (!file_
ZM\
require_once $includeFile;
}
// If the view overrides $view to 'error', and the user is not logged in, then the
// issue is probably resolvable by logging in, so provide the opportunity to do so.
// The login view should handle redirecting to the correct location afterward.
if ( $view == 'error' && !isset($user) ) {
$view = 'login';
foreach ( getSkinIncludes
require_once $includeFile;
}
while (ob_get_level() > 0) ob_end_flush();
} # end if include files for view
// If the view is missing or the view still returned error with the user logged in,
// then it is not recoverable.
if ( !$includeFiles || $view == 'error' ) {
foreach ( getSkinIncludes
require_once $includeFile;
}
?>
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Ubuntu Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Kendall Stone for more information if necessary.