Premature end of script headers: zms on Debian

Support and queries relating to all previous versions of ZoneMinder
Locked
bhomass
Posts: 103
Joined: Sat Jun 11, 2005 6:54 pm

Premature end of script headers: zms on Debian

Post by bhomass »

Hi, I had zoneminder 1.21.3 working very well on Suse before. Now I migrated over to debian and can not get a single image up.

I check every single posting which had this error message
Premature end of script headers: zms

set configure to no authentication/plain. got libssl-dev. checked to make sure zms script is found by
http://ip/cgi-bin/zms?mode=jpeg&monitor ... 0&maxfps=5

all zm files are owed by apache/apache.

what else is that that stop the image from showing?
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

What do you see in /var/log/messages or your httpd error log? Have you tried using nph-zms instead of zms?

Also try running zms from the command line and seeing if it output something that might indicate what the problem is.

Phil
bhomass
Posts: 103
Joined: Sat Jun 11, 2005 6:54 pm

Post by bhomass »

nothing interesting in /var/log/messages.

httpd error.log is the one that says
Premature end of script headers: zms

running zms from the command line produces

debian:/var/www/cgi-bin# ./zms mode=jpeg monitor=1 scale=100 maxfps=5
Server: ZoneMinder Video Server/1.21.3
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: Mon, 05 Dec 2005 23:09:10 GMT
Cache-Control: no-store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0
Pragma: no-cache

nph-zms produces very similar messags

when changed zms to nph-zms in config, there is no response back to the browser, and no message in /var/log/apache2/error.log.

I have verified that the web server is finding the zms and nph-zms scripts.

I changed the video format to mpeg, now I get a black screen for streaming, a blank for still. it says 2.67 fps at the bottom. (what sets the fps?)

on the index page, both Function and Source entries are orange. zmc is running.

again, xawtv works off the same video input just fine.

what else can I check?
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Running from the command line is the next step. I think if you search for QUERY_STRING you should find some pointers on how to do this if you don't know already.

Phil
bhomass
Posts: 103
Joined: Sat Jun 11, 2005 6:54 pm

Post by bhomass »

I thought I did that.

I did export QUERY_STRING='....'

and zms produced

debian:/usr/lib/cgi-bin$ ./zms
Server: ZoneMinder Video Server/1.21.3
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: Tue, 06 Dec 2005 22:08:25 GMT
Cache-Control: no-store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0
Pragma: no-cache

it looks ok to me. any ideas from this?
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Oops. missed that sorry. Did it return to the command line after just those headers? If so then that is wrong, you should see a continuous stream. I also assume you did something like

Code: Select all

export QUERY_STRING='mode=jpeg&monitor=1&scale=100&maxfps=5
rather than using spaces as in your example. If you are using authentication then you will need to include parameters to pass that such as auth-xxx, or username=yyy and password=zzz

Phil
bhomass
Posts: 103
Joined: Sat Jun 11, 2005 6:54 pm

Post by bhomass »

to be exact, I did
export QUERY_STRING='mode=single&monitor=1&scale=100'

both ./nph-zms and ./zms produce a continuous stream, and then get stuck. which differs from what it did before. however, I still get a blank for still.

I also tested 'mode=mpeg&monitor=1&scale=100&bitrate=25000&maxfps=5&format=asf'.
I get a continuous stream in this case. so it looks like it should be working. but my screen is totally black.

I am testing in no authentication to make things easier.

so now what can I do?
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

The premature end of script headers usually implies that something is crashing or not starting which would appear not to be the case for you. However you mention that zms gets stuck, I assume you mean it just stops producing output? If so after how long? Presumably you are redirecting output to a file and it's not just that your terminal is barfing after eating control chars?

As it's a new distro to you, are you sure you have apache set up for cgi correctly?

Phil
bhomass
Posts: 103
Joined: Sat Jun 11, 2005 6:54 pm

Post by bhomass »

right, when redirected into a file, zms for single mode does not get stuck. the file contains the headers and a long trail of binaries. zms for mpeg mode writes into the file continuously until stopped manually. so everything looks good there.

I tried setting the cgi-bin directory to both /var/www/cgi-bin and /usr/lib/cgi-bin. made no difference. I tried changing file name or zms, and the webserver reports it can not find zms, so it is looking at the right place. I don't see what else can go wrong there.

as of now, I get a black streaming screen and a blank still screen. xawtv shows that channel just fine.

doesn't it look like zms is called and executed, and returns the right stuff to apache2, which is not able to read the reply? is there a module I need to load into apache for it to properly execute a c-binary as a cgi program?

does someone know if I can crop the output file and convert it to a good jpeg image for testing?
Locked