Can not log in web interface

Support and queries relating to all previous versions of ZoneMinder
stackbit
Posts: 18
Joined: Fri Feb 04, 2005 1:03 am

Post by stackbit »

I did it. And still I am having the login problem...
stackbit
Posts: 18
Joined: Fri Feb 04, 2005 1:03 am

Now i am logging in...

Post by stackbit »

I tried reinstalling the apache and mysql packages as sugested but still couldn't login.

Tried then to redo it but with

apt-get install apache.... -t testing

after that I ran

/usr/sbin/apache-modconf apache

and restarted apache /etc/init.d/apache restart

just to be sure that everything was clean.

And voilá, could login again... :)

The problem really is in the apache mysql unstable packages, revert to testing to solve it.
User avatar
lazyleopard
Posts: 403
Joined: Tue Mar 02, 2004 6:12 pm
Location: Gloucestershire, UK

Post by lazyleopard »

Hmmm... May work for Debian, but not for Gentoo. Do you know exactly which versions of things like mysql, apache, and php you're using, and any particular compile-time options?

Gentoo's just about to push mysql 4.1.14 to stable. Apparently the conversion process from 4.0.25 (which I'm using at present) isn't entirely transparent...
Rick Hewett
stackbit
Posts: 18
Joined: Fri Feb 04, 2005 1:03 am

Versions...

Post by stackbit »

I believe this should do it... Refer to testing packages

server0:/etc/apache# apt-cache show libapache-mod-php4 libapache-mod-auth-mysql php4-mysql zm

Package: libapache-mod-php4
Priority: optional
Section: web
Installed-Size: 3092
Maintainer: Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>
Architecture: i386
Source: php4
Version: 4:4.4.0-3
Replaces: php4 (<< 4:4.3.8-6)
Provides: phpapi-20050606
Depends: libbz2-1.0, libc6 (>= 2.3.5-1), libcomerr2 (>= 1.33-3), libdb4.2, libexpat1 (>= 1.95.8), libgdbm3, libkrb53 (>= 1.3.2), libpcre3 (>= 4.5), libssl0.9.8, libzzip-0-12 (>= 0.12.83), zlib1g (>= 1:1.2.1), debconf (>= 0.5) | debconf-2.0, mime-support (>= 2.03-1), apache-common (>= 1.3.33), php4-common (= 4:4.4.0-3), libmagic1
Suggests: php-pear
Conflicts: php3
Filename: pool/main/p/php4/libapache-mod-php4_4.4.0-3_i386.deb
Size: 1572214
MD5sum: e8315e8e3ac07e6a84563191153b693b
Description: server-side, HTML-embedded scripting language (apache 1.3 module)
This package provides the PHP4 module for the Apache 1.3 webserver (as
found in the apache, apache-ssl, and apache-perl packages). To use php4
with Apache 2.0, you probably want libapache2-mod-php4 instead.
.
Compiled in extensions include: bcmath, bz2, calendar, ctype, dba, dbx,
exif, filepro, ftp, gettext, iconv, mbstring, mime_magic, openssl, overload,
pcre, posix, session, shmop, sockets, standard, sysvmsg, sysvsem, sysvshm,
tokenizer, wddx, xml, xmlrpc, yp, zip, and zlib.
.
PHP4 is an HTML-embedded scripting language. Much of its syntax is borrowed
from C, Java and Perl with a couple of unique PHP-specific features thrown
in. The goal of the language is to allow web developers to write dynamically
generated pages quickly.
.
Homepage: http://www.php.net/
Tag: langdevel::php, suite::apache

Package: libapache-mod-php4
Priority: optional
Section: web
Installed-Size: 3156
Maintainer: Adam Conrad <adconrad@0c3.net>
Architecture: i386
Source: php4
Version: 4:4.3.10-16
Replaces: php4-dev (<< 4.0.2-6), php4-xml, php4 (<< 4:4.3.8-6)
Provides: php4-xml, phpapi-20020918
Depends: libbz2-1.0, libc6 (>= 2.3.2.ds1-21), libcomerr2 (>= 1.33-3), libdb4.2, libexpat1 (>= 1.95.8), libkrb53 (>= 1.3.2), libpcre3 (>= 4.5), libssl0.9.7, libzzip-0-12 (>= 0.12.83), zlib1g (>= 1:1.2.1), debconf (>= 0.5) | debconf-2.0, mime-support (>= 2.03-1), apache-common (>= 1.3.33), php4-common (= 4:4.3.10-16), libmagic1
Suggests: php4-pear
Conflicts: php3, php4-dev (<< 4.0.4-1), php4-cgi (<< 4.0.4-1), php4-cgi-curl, php4-cgi-domxml, php4-cgi-gd, php4-cgi-imap, php4-cgi-ldap, php4-cgi-mhash, php4-cgi-mysql, php4-cgi-pgsql, php4-cgi-snmp, php4-cgi-xml, php4-xml, php4-sablot
Filename: pool/main/p/php4/libapache-mod-php4_4.3.10-16_i386.deb
Size: 1614254
MD5sum: 38cc33f1a4c6a70af7f6749cdf9694f6
Description: server-side, HTML-embedded scripting language (apache 1.3 module)
This package provides the PHP4 module for the Apache 1.3 webserver (as
found in the apache, apache-ssl, and apache-perl packages). To use php4
with Apache 2.0, you probably want libapache2-mod-php4 instead.
.
Compiled in extensions include: bcmath, bz2, calendar, ctype, dba, dbx,
exif, filepro, ftp, gettext, iconv, mbstring, mime_magic, openssl, overload,
pcre, posix, session, shmop, sockets, standard, sysvmsg, sysvsem, sysvshm,
tokenizer, wddx, xml, xmlrpc, yp, zip, and zlib.
.
PHP4 is an HTML-embedded scripting language. Much of its syntax is borrowed
from C, Java and Perl with a couple of unique PHP-specific features thrown
in. The goal of the language is to allow web developers to write dynamically
generated pages quickly.
.
Homepage: http://www.php.net/
Tag: langdevel::php, suite::apache

Package: libapache-mod-auth-mysql
Priority: optional
Section: web
Installed-Size: 61
Maintainer: Matthew Palmer <mpalmer@debian.org>
Architecture: i386
Version: 4.3.9-2
Depends: libc6 (>= 2.3.2.ds1-4), libmysqlclient12, apache-common (>= 1.3.22-6)
Conflicts: apache-common (<< 1.3.22-6)
Filename: pool/main/liba/libapache-mod-auth-mysql/libapache-mod-auth-mysql_4.3.9-2_i386.deb
Size: 21844
MD5sum: 24faf38ef0e1c7b5ef53152b40d874da
Description: Apache module for MySQL authentication
A module for the Apache web server which enables HTTP authentication
against information stored in a MySQL database.
.
If you're looking for a version of this module for apache2, please see
libapache2-mod-auth-mysql.
Tag: devel::library, interface::daemon, role::sw:server, suite::apache, web::server

Package: php4-mysql
Priority: optional
Section: web
Installed-Size: 100
Maintainer: Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>
Architecture: i386
Source: php4
Version: 4:4.4.0-3
Depends: libc6 (>= 2.3.5-1), libmysqlclient12, debconf (>= 0.5) | debconf-2.0, phpapi-20050606, php4-common (= 4:4.4.0-3)
Filename: pool/main/p/php4/php4-mysql_4.4.0-3_i386.deb
Size: 21604
MD5sum: 20b79ffc553a4453819749e856270a03
Description: MySQL module for php4
This package provides a module for MySQL database connections directly from
PHP scripts.
.
PHP4 is an HTML-embedded scripting language. Much of its syntax is borrowed
from C, Java and Perl with a couple of unique PHP-specific features thrown
in. The goal of the language is to allow web developers to write
dynamically generated pages quickly.
Tag: devel::library, langdevel::php, made-of::lang:php, works-with::db:sql

Package: php4-mysql
Priority: optional
Section: web
Installed-Size: 112
Maintainer: Adam Conrad <adconrad@0c3.net>
Architecture: i386
Source: php4
Version: 4:4.3.10-16
Replaces: php4-cgi-mysql
Depends: libc6 (>= 2.3.2.ds1-21), libmysqlclient12, debconf (>= 0.5) | debconf-2.0, phpapi-20020918, php4-common (= 4:4.3.10-16)
Filename: pool/main/p/php4/php4-mysql_4.3.10-16_i386.deb
Size: 21224
MD5sum: 17f84133fa9b36f5d64bfd05dd620998
Description: MySQL module for php4
This package provides a module for MySQL database connections directly from
PHP scripts.
.
PHP4 is an HTML-embedded scripting language. Much of its syntax is borrowed
from C, Java and Perl with a couple of unique PHP-specific features thrown
in. The goal of the language is to allow web developers to write
dynamically generated pages quickly.
Tag: devel::library, langdevel::php, made-of::lang:php, works-with::db:sql

Package: zm
Version: 1.21.3-4
Priority: optional
Section: unknown
Maintainer: Francois Gurin <matrix@spic.net>
Depends: ffmpeg, php4-mysql, php4, libdate-manip-perl, libmime-perl, libdbd-mysql-perl, mysql-server, mysql-client, libavcodec2, libc6 (>= 2.3.5-1), libgcc1 (>= 1:4.0.0-9), libjpeg62, liblame0 (>= 3.96.1-1), libmysqlclient14, libpcre3 (>= 4.5), libssl0.9.7, libstdc++6 (>= 4.0.1), zlib1g (>= 1:1.2.1)
Architecture: i386
Filename: ./zm_1.21.3-4_i386.deb
Size: 1095378
Installed-Size: 3432
MD5sum: abb87fd4b10e1a7a72c41dce25792bc2
Description: Video security camera monitoring and analysis tool
ZoneMinder is intended for use in single or multi-camera video
security applications, including theft prevention and child or
family member or home monitoring and other care scenarios. It
supports capture, analysis, recording, and monitoring of video
data coming from one or more video or network cameras attached
to a Linux system. ZoneMinder also support web and semi-automatic
control of Pan/Tilt/Zoom cameras using a variety of protocols.
merced
Posts: 13
Joined: Thu Oct 13, 2005 3:27 pm

Post by merced »

I got it to work! :D

Reading the user comments on this page from PHP.net I realized there might be something wrong with the way ZoneMinder is handling cookies. This was evident from setting $debug = true in zm.php and getting an error like:

Code: Select all

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/localhost/htdocs/zoneminder/zm.php:29) in /var/www/localhost/htdocs/zoneminder/zm.php on line 150
I commented out the session_start(); on line 150 and instead just threw it up to line 2 instead. I was able to login! Of course, I still got a ton of other warnings after logging in.

Code: Select all

Warning: Cannot modify header information - headers already sent by (output started at /var/www/localhost/htdocs/zoneminder/zm.php:29) in /var/www/localhost/htdocs/zoneminder/zm_html_view_console.php on line 36

Warning: Cannot modify header information - headers already sent by (output started at /var/www/localhost/htdocs/zoneminder/zm.php:29) in /var/www/localhost/htdocs/zoneminder/zm_html_view_console.php on line 37

Warning: Cannot modify header information - headers already sent by (output started at /var/www/localhost/htdocs/zoneminder/zm.php:29) in /var/www/localhost/htdocs/zoneminder/zm_html_view_console.php on line 38

Warning: Cannot modify header information - headers already sent by (output started at /var/www/localhost/htdocs/zoneminder/zm.php:29) in /var/www/localhost/htdocs/zoneminder/zm_html_view_console.php on line 39

Warning: Cannot modify header information - headers already sent by (output started at /var/www/localhost/htdocs/zoneminder/zm.php:29) in /var/www/localhost/htdocs/zoneminder/zm_html_view_console.php on line 40
But I know I'm on the right track. I'll leave it to the maintainers to figure out where the session_start(); calls need to be placed in the code. Hopefully it will be fixed in the next release of ZoneMinder.

I can at least start using ZoneMinder!

Thanks to everyone for the help they have given on this problem. :)
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

I think what you are seeing is that all the header sending functions are failing as they must emit their output before any other content is served. This they normally do but when you put debug on they don't. So they are warning you about it.

I don't know, yet, why this should make any difference to whether you can log in or not though.

Phil
zherebet
Posts: 31
Joined: Sun Jul 31, 2005 7:38 pm

Post by zherebet »

Confirmed FIX on my end:

Followed merced's instructions, commented out the session_start() in zm.php on line 150 and moved session_start to the the 24th line (right after import_request_variables("CGP");

Turn off debugging - and voila! Log-in works!

Thank's merced!
Regards,

Ilya Zherebetskiy
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Thanks to Rick (aka lazyleopard) I've been able to spend a bit of time on this and I now know why the problem occurs. What I don't know is why it only occurs on php 4.4 but that's another issue.

The 'official' fix for this is to change the line

Code: Select all

setcookie( "format", $format );
at the bottom of zm.php to

Code: Select all

setcookie( "format", $format );
setcookie( "cookies", $cookies );
for now.

However I expect to modify this somewhat for 1.21.4. I _think_ this should work and not break any other functionality but I won't consider this issue closed until I've heard confirmations that the problem no longer occurs, and I've tested it on other versions of php to make sure it doesn't create any new problems!

Phil
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

I forgot to mention that you should remove all existing cookies once before trying to log in again. After that you should be ok.

Phil
zherebet
Posts: 31
Joined: Sun Jul 31, 2005 7:38 pm

Post by zherebet »

That fix works on my end as well (php 4.4.0) - what was the problem?
Regards,

Ilya Zherebetskiy
sekuz
Posts: 2
Joined: Thu Oct 20, 2005 3:25 pm
Location: Russia, Zlatoust

Post by sekuz »

Apache/2.0.54 (Unix) mod_ssl/2.0.54 OpenSSL/0.9.8 PHP/5.0.5 DAV/2 mod_perl/2.0.1 Perl/v5.8.7

It's work!!!! Thanks.
merced
Posts: 13
Joined: Thu Oct 13, 2005 3:27 pm

Post by merced »

That fix seems to work for me. Now I just have to figure out how to set up my Axis 205 to work with ZoneMinder. :?
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

if you want to start a new thread on your 205 as i have 6 206 running great
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
merced
Posts: 13
Joined: Thu Oct 13, 2005 3:27 pm

Post by merced »

User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

sekuz,
Just curious if you had to enable the compatibility for zend 1 engine in your php 5?

Regards,
Cordel
Locked