When I brwoser this perl script on the web broswer, it gives error: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request
In error.log: [Tue Jun 25 14:20:22 2002] [error] [client 130.91.8.66] Premature end of script headers: /db4/usr/local/www/html_files/cgi-bin/emboss.pl
But other cgi or perl script in the same directory work fine.
I do not know hwat is wrong with this script, here is this script: #!/compbio/programs/perl-5.6.1/bin/perl5.6.1
use CGI; use EMBOSS::GUI;
my $cgi = new CGI; print "Content-type: text/html\r\n\r\n"; init('/compbio/programs/emboss/share/EMBOSS', '/compbio/programs/emboss/bin', '/db4/usr/local/www/html_files/html/EMBOSS', 'http://athena .wistar.upenn.edu/EMBOSS', 'http://athena.wistar.upenn.edu/cgi-bin', 0); for ($cgi->param("_action")) { /^mmenu/ and do { mmenu($cgi); last; }; /^input/ and do { input($cgi); last; }; /^run/ and do { run($cgi); last; }; /^help/ and do { help($cgi); last; }; /^manual/ and do { manual($cgi); last; }; /^search/ and do { search($cgi); last; }; } print "\n"; ~ Any idea will be appreciated greatly.
Hello All,> writing to a flat file I am getting 500 error with Apache. I > know the path is correct and when I delete the file.txt and try > to write to it. A new file is created but no writing. What does > Premature end of script headers: mean?
It usually means the execution of the script aborted in a way that Apache wasn't expecting - I'd say something has gone seriously wrong in the script, you might want to add a few debugging statements and see from there where a problem may lie.
Hello All, writing to a flat file I am getting 500 error with Apache. I know the path is correct and when I delete the file.txt and try to write to it. A new file is created but no writing. What does Premature end of script headers: mean?
You wrote:> hi.> what is the meaning of:> Premature end of script headers.
The script headers terminated before the double-newline. Probably because you sent content to the browser before sending a content type. Or some type of error occured, which there will be information about in the error log. This sounds more like a Perl or other CGI app issue, rather than a PHP issue, though, because PHP errors get sent to the browser.
Brett W. McCoy 19 September 2001 21:54:36 [ permanent link ]
On Wed, 19 Sep 2001, SAWMaster wrote:
What is wrong with this line?>
print qq~</FORM>\n~;>
Some reserved word in there?>
The error is "Premature end of script headers....if that helps.>
If I take that line out it works fine (CGI wise, not HTML wise)>
Can someone help me?
Of course, without seeing the code in context, it's hard to say why a single line wouldn't be working correctly.
-- Brett http://www.chapelperilous.net/ ------------------------------------------------------------------------ Sho' they got to have it against the law. Shoot, ever'body git high, they wouldn't be nobody git up and feed the chickens. Hee-hee. -- Terry Southern
Your HTML is not structured correctly because you don't have <BODY></BODY> enclosing everything.
For things like this, I recommend using HERE docs or CGI.pm -- it's difficult to read and debug the HTML with all of those print statement, and CGI.pm takes care of things like headers, CGI parameter parsing and will make your life a lot esier in the long run.
-- Brett http://www.chapelperilous.net/ ------------------------------------------------------------------------ Someone is unenthusiastic about your work.
Randal L. Schwartz 19 September 2001 22:53:23 [ permanent link ]
"Brett" == Brett W McCoy <bmccoy@chapelperilous.net> writes:
Brett> On Wed, 19 Sep 2001, SAWMaster wrote:>> What is wrong with this line?>>
print qq~</FORM>\n~;>>
Some reserved word in there?>>
The error is "Premature end of script headers....if that helps.>>
If I take that line out it works fine (CGI wise, not HTML wise)>>
Can someone help me?
Brett> Of course, without seeing the code in context, it's hard to say why a Brett> single line wouldn't be working correctly.
Right. The line ahead of it might be:
die "Premature end of script headers....if that helps.\n";
We haven't even yet established that this is CGI, fercrissakes.
Context, people. Context. We ain't psychic. Tell us what you were trying to do, what you did, what it said, and WHAT YOU'VE DONE to try to solve it on your own, first.
Doesn't it say something like that in the VERY FREQUENTLY POSTED FAQ?
-- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
Hello, Can somebody give me a clue as to what this cgi error message means? premature end of script headers: /var/www/cgi-bin/office.cgi
Thank You Richard Verdugo _______________________________________________ ActivePerl mailing list ActivePerl@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
We will need to see the script in order to help. Does the error give a line number?
Scott Campbell Senior Software Developer Somix Technologies (207) 324-8805 http://www.somix.com
-----Original Message----- From: activeperl-admin@listserv.ActiveState.com [mailto:activeperl-admin@listserv.ActiveState.com] On Behalf Of Verdugo, Richard Sent: Friday, May 31, 2002 2:56 PM To: activeperl@listserv.activestate.com Subject: Premature end of script headers
Hello, Can somebody give me a clue as to what this cgi error message means? premature end of script headers: /var/www/cgi-bin/office.cgi
Thank You Richard Verdugo _______________________________________________ ActivePerl mailing list ActivePerl@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Can somebody give me a clue as to what this cgi error message means? > premature end of script headers: /var/www/cgi-bin/office.cgi>
Generally you need to provide a lot more information before there is any realistic chance of people on the list helping you. We don't know what the application is, what OS you're using, what web server, what version of perl, whether you wrote office.cgi yourself or it's a canned script, and so on and so on.
Does office.cgi even work from the command line? Have you tried any kind of debugging?
People are usually only willing to help those who at least try to help themselves.
"Be very, very careful what you put into that head, because you will never, ever get it out." --- Thomas Cardinal Wolsey (1471-1530)
********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager.
This footnote also confirms that this email message has been swept by the latest virus scan software available for the presence of computer viruses. **********************************************************************
It generally means that your script terminated abnormally, before providing appropriate headers (i.e. content-type) for the httpd/browser to interpret.
-Peter
-----Original Message----- From: Scott Campbell To: 'Verdugo, Richard'; activeperl@listserv.activestate.com Sent: 5/31/2002 12:07 PM Subject: RE: Premature end of script headers
We will need to see the script in order to help. Does the error give a line number?
Scott Campbell Senior Software Developer Somix Technologies (207) 324-8805 http://www.somix.com
-----Original Message----- From: activeperl-admin@listserv.ActiveState.com [mailto:activeperl-admin@listserv.ActiveState.com] On Behalf Of Verdugo, Richard Sent: Friday, May 31, 2002 2:56 PM To: activeperl@listserv.activestate.com Subject: Premature end of script headers
Hello, Can somebody give me a clue as to what this cgi error message means? premature end of script headers: /var/www/cgi-bin/office.cgi
Thank You Richard Verdugo _______________________________________________ ActivePerl mailing list ActivePerl@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
I don't know the first thing about CGI, but what does it have to do with Perl? So in addition to providing as much information as possible, I'm going to go out on a limb and also suggest the proper forum as well
-----Original Message-----> From: Hemphill, Barry [mailto:BHemphill@concord.com]> Sent: Friday, May 31, 2002 3:14 PM> To: activeperl@listserv.activestate.com> Cc: 'Verdugo, Richard'> Subject: RE: Premature end of script headers>
rverdugo@huntington.org wrote:> >
Can somebody give me a clue as to what this cgi error > message means? > > premature end of script headers: /var/www/cgi-bin/office.cgi> >
Generally you need to provide a lot more information before > there is any> realistic chance of people on the list helping you. We don't > know what the> application is, what OS you're using, what web server, what > version of perl,> whether you wrote office.cgi yourself or it's a canned > script, and so on and> so on.>
Does office.cgi even work from the command line?> Have you tried any kind of debugging?>
People are usually only willing to help those who at least try to help> themselves.>
"Be very, very careful what you put into that head, because > you will never,> ever get it out."> --- Thomas Cardinal Wolsey (1471-1530)>
**********************************************************************> This email and any files transmitted with it are confidential and> intended solely for the use of the individual or entity to whom they> are addressed. If you have received this email in error please notify> the system manager.>
This footnote also confirms that this email message has been swept by> the latest virus scan software available for the presence of computer > viruses.> **********************************************************************>
Make sure that the script is set with the execute bit.
Also... I've never seen the \r used in the Content-type piece... I've always used \n\n... .might want to try that, though I'm not sure.
- Terry
On Tuesday, June 25, 2002, at 12:24 PM, Qingjuan Gu wrote:
Hi everybody,>
When I brwoser this perl script on the web broswer, it gives error:> Internal Server Error> The server encountered an internal error or misconfiguration and was > unable to complete your request>
In error.log:> [Tue Jun 25 14:20:22 2002] [error] [client 130.91.8.66] Premature end > of script headers: /db4/usr/local/www/html_files/cgi-bin/emboss.pl>
But other cgi or perl script in the same directory work fine.>
I do not know hwat is wrong with this script, here is this script:> #!/compbio/programs/perl-5.6.1/bin/perl5.6.1>
use CGI;> use EMBOSS::GUI;>
my $cgi = new CGI;> print "Content-type: text/html\r\n\r\n";> init('/compbio/programs/emboss/share/EMBOSS', > '/compbio/programs/emboss/bin', > '/db4/usr/local/www/html_files/html/EMBOSS', 'http://athena> .wistar.upenn.edu/EMBOSS', 'http://athena.wistar.upenn.edu/cgi-bin', 0);> for ($cgi->param("_action")) {> /^mmenu/ and do { mmenu($cgi); last; };> /^input/ and do { input($cgi); last; };> /^run/ and do { run($cgi); last; };> /^help/ and do { help($cgi); last; };> /^manual/ and do { manual($cgi); last; };> /^search/ and do { search($cgi); last; };> }> print "\n";> ~> Any idea will be appreciated greatly.>
Grace>
---------------------------------------------------------------------> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org> For additional commands, e-mail: users-help@httpd.apache.org>
Robert Andersson 26 June 2002 11:07:34 [ permanent link ]
This is a CGI/Perl-problem rather than Apache. But, anyway, the error says that the script (or cgi-handler) outputs something else than legal HTTP-headers, and is usually caused if your program has an error in it. By looking in the error log you should see what the script did output that caused the error. This is usually a perl error message, which you can use to fix your code. If that is not helping, it's just ordinarily debuging; strip everything but the print "Content-type: text/ht..." (and replace "\r\n\r\n" with simply "\n\n"), and then add the use statements, then the new statement, etc. untill you find the error.
Regards, Robert Andersson
----- Original Message ----- From: "Qingjuan Gu" <qingjuan@wistar.upenn.edu> To: <users@httpd.apache.org> Sent: Tuesday, June 25, 2002 8:24 PM Subject: Premature end of script headers
Hi everybody,>
When I brwoser this perl script on the web broswer, it gives error:> Internal Server Error> The server encountered an internal error or misconfiguration and was
unable to complete your request>
In error.log:> [Tue Jun 25 14:20:22 2002] [error] [client 130.91.8.66] Premature end of
But other cgi or perl script in the same directory work fine.>
I do not know hwat is wrong with this script, here is this script:> #!/compbio/programs/perl-5.6.1/bin/perl5.6.1>
use CGI;> use EMBOSS::GUI;>
my $cgi = new CGI;> print "Content-type: text/html\r\n\r\n";> init('/compbio/programs/emboss/share/EMBOSS',
'/compbio/programs/emboss/bin', '/db4/usr/local/www/html_files/html/EMBOSS', 'http://athena> .wistar.upenn.edu/EMBOSS', 'http://athena.wistar.upenn.edu/cgi-bin', 0);> for ($cgi->param("_action")) {> /^mmenu/ and do { mmenu($cgi); last; };> /^input/ and do { input($cgi); last; };> /^run/ and do { run($cgi); last; };> /^help/ and do { help($cgi); last; };> /^manual/ and do { manual($cgi); last; };> /^search/ and do { search($cgi); last; };> }> print "\n";> ~> Any idea will be appreciated greatly.>
Grace>
---------------------------------------------------------------------> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org> For additional commands, e-mail: users-help@httpd.apache.org>
Hi, I am using Apache 2.0.3.9.I have a .cgi file.When I execute it, it state thee errors....
Server error!>>Error message: >>Premature end of script headers: guestbook.cgi
I have attached the .cgi file
Please help
Best Regards Raymond
_________________________________________________________ ÅμƽX¬Û¨C±i¥u«Y $1.2¡I Print your digital photos for $1.2 each only http://photos.yahoo.com.hk
$bgcolor = "eeeecc"; # color of background $text = "000000"; # color of text #End of Setup ####################### print "Content-type: text/html\n"; print "Pragma:no-cache\n\n";
{ local ($oldbar) = $|; $cfh = select (STDOUT); $| = 1; # # print your HTTP headers here # $| = $oldbar; select ($cfh); } e"t_data; &set_var;
($nsec,$nmin,$nhour,$nday,$nmon,$nyear,$wday,$yday,$isdst) = localtime(time+($time_miss*3600)); $nmon++; if ($nmon<10) {$nmon="0$nmon";} if ($nday<10) {$nday="0$nday";} if ($nhour<10){$nhour="0$nhour";} if ($nmin<10) {$nmin="0$nmin";} if ($nsec<10) {$nsec="0$nsec";} $normal_time = "$nyear/$nmon/$nday($nhour\nmin)"; $userhost = $ENV{'REMOTE_HOST'}; } ##################### sub get_new_number { open(MAIN,"$numberfile") || die $!; $number = <MAIN>; close(MAIN);
$number=int($number)+1;
open(MAIN,">$numberfile") || die $!; print MAIN "$number"; close(MAIN); } ##################### sub write_main { $write_main_subject = $_[0];
open(MAIN,"$mainfile") || die $!; @main = <MAIN>; close(MAIN);
if ($write_main_subject eq "add") {
open(MAIN,">$mainfile") || die $!; foreach $main_line (@main) { if ($main_line =~ /<!--begin-->/) { print MAIN "<!--begin-->\n"; print MAIN "<!--number=$number--head-->\n"; print MAIN "<font size=3>"; print MAIN "<img src=$ledgifurl>$says<br>"; print MAIN "</font>\n"; print MAIN "<font size=2><i><b>"; print MAIN "By $username "; if ($usermail) { print MAIN "E-mail\:<a href=\"mailtousermail\">$usermail</a>"; } print MAIN "<br>"; if ($userurl){ print MAIN "Url\:<a href=\"$userurl\" target=\"windows\">$userurl</a><br>"; } print MAIN "</b></i></font>"; print MAIN "<font size=1><i>At\normal_time Host\userhost</i></font>"; print MAIN "<hr width=400 align=left size=1>\n"; print MAIN "<!--number=$number--end-->\n"; } else { print MAIN "$main_line"; } } close(MAIN);
} elsif ($write_main_subject eq "managedel") { $temp=1; open(MAIN,">$mainfile") || die $!; foreach $main_line (@main) { if ($main_line =~ /<!--number=$number--head-->/) { $temp=2; print MAIN ""; } elsif ($main_line =~ /<!--number=$number--end-->/) { $temp=3; print MAIN ""; } elsif ($temp==2) { print MAIN ""; } else { print MAIN "$main_line"; } } close(MAIN); }
}
############ sub return_request { $return_request_subject = $_[0];
open(MAIN,"$mainfile") || die $!; @main = <MAIN>; close(MAIN);
--------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org
Robert D. Nelson 20 August 2002 17:52:19 [ permanent link ]
Raymond:
The error you describe happens when the script attempts to output via CGI but sends it without header information to tell the server what to do with it. The most common reason for this is when the programmer forgets to add a...
print "Content-type: text/html\n\n";
...line to the top of HTML output.
Either way, this is a programming problem, not an Apache problem.
~ Robert
-----Original Message----- From: Boyle Owen [mailto:Owen.Boyle@swx.com] Sent: Tuesday, August 20, 2002 7:37 AM To: users@httpd.apache.org Subject: RE: Premature end of script headers???
Easy. Your program didn't work.
Do:
- try from the command line, does it work? - does it output a valid CGI header? - enable ScriptLog to trap STDERR
Rgds,
Owen Boyle.
-----Original Message----->From: Chan Raymond [mailto:cwraymond2000@yahoo.com.hk]>Sent: Dienstag, 20. August 2002 14:32>To: users@httpd.apache.org>Subject: Premature end of script headers???>
Hi,>I am using Apache 2.0.3.9.I have a .cgi file.When I>execute it, it state thee errors....>
Server error!>>>Error message: >>>Premature end of script headers: guestbook.cgi >
I have attached the .cgi file>
Please help>
Best Regards>Raymond>
_________________________________________________________>???????? $1.2!>Print your digital photos for $1.2 each only>http://photos.yahoo.com.hk>
--------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org
--------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org
Dirk-Willem van Gulik 20 August 2002 18:16:48 [ permanent link ]
On Tue, 20 Aug 2002, Nelson, Robert D. wrote:
The error you describe happens when the script attempts to output via CGI> but sends it without header information to tell the server what to do with> it. The most common reason for this is when the programmer forgets to add> a...>
print "Content-type: text/html\n\n";>
...line to the top of HTML output.>
Either way, this is a programming problem, not an Apache problem.
Or somehow some other output manages to be send out before the above. what can help during troubleshooting is to put
$|=1; print "Content-type: text/plain\n\n";
as the very first two lines of your perl script. This may help you debug what is actually written by your script. A common culprit is an unexpected error which writes something before the script has written its proper content-type string.
Dw
--------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org
--- Dirk-Willem van Gulik <dirkx@webweaving.org> ªº¶l¥ó¤º®e¡G> > Somehow your script outputs something *before* it> gets to these print> statements. Just put on the first two lines of the> script>
$|=1;print "Content-type: text/plain\r\n\r\n";>
to find out -what- is being printed. Or move the> print's below up to the> top.>
Dw.>
On Wed, 21 Aug 2002, [big5] Chan Raymond wrote:>
Sorry...I am a idiot.....> >
I don't know what u are talkin' about. Can you> explain> > it to me in detail.> >
{> > local ($oldbar) = $|;> > $cfh = select (STDOUT);> > $| = 1;> > #> > # print your HTTP headers here> > #> > $| = $oldbar;> > select ($cfh);> > }> > .....> > in the guestbook.cgi.> > What is it means?> >
Can anyone also tell me howto test the .cgi file> in> > command line.> >
Thank you very much and Best Regards> > Raymond> >
--- Dirk-Willem van Gulik <dirkx@webweaving.org>> > ªº¶l¥ó¤º®e¡G>> > >
On Tue, 20 Aug 2002, Nelson, Robert D. wrote:> > >
The error you describe happens when the script> > > attempts to output via CGI> > > > but sends it without header information to> tell> > > the server what to do with> > > > it. The most common reason for this is when> the> > > programmer forgets to add> > > > a...> > > >
print "Content-type: text/html\n\n";> > > >
...line to the top of HTML output.> > > >
Either way, this is a programming problem, not> an> > > Apache problem.> > >
Or somehow some other output manages to be send> out> > > before the above. what> > > can help during troubleshooting is to put> > >
as the very first two lines of your perl script.> > > This may help you debug> > > what is actually written by your script. A> common> > > culprit is an unexpected> > > error which writes something before the script> has> > > written its proper> > > content-type string.> > >
---------------------------------------------------------------------> > > The official User-To-User support forum of the> > > Apache HTTP Server Project.> > > See <URL:http://httpd.apache.org/userslist.html>> for> > > more info.> > > To unsubscribe, e-mail:> > > users-unsubscribe@httpd.apache.org> > > " from the digest:> > > users-digest-unsubscribe@httpd.apache.org> > > For additional commands, e-mail:> > > users-help@httpd.apache.org> > >
_________________________________________________________> > ÅμƽX¬Û¨C±i¥u«Y $1.2¡I> > Print your digital photos for $1.2 each only> > http://photos.yahoo.com.hk> >
---------------------------------------------------------------------> > The official User-To-User support forum of the> Apache HTTP Server Project.> > See <URL:http://httpd.apache.org/userslist.html>> for more info.> > To unsubscribe, e-mail:> users-unsubscribe@httpd.apache.org> > " from the digest:> users-digest-unsubscribe@httpd.apache.org> > For additional commands, e-mail:> users-help@httpd.apache.org> >
---------------------------------------------------------------------> The official User-To-User support forum of the> Apache HTTP Server Project.> See <URL:http://httpd.apache.org/userslist.html> for> more info.> To unsubscribe, e-mail:> users-unsubscribe@httpd.apache.org> " from the digest:> users-digest-unsubscribe@httpd.apache.org> For additional commands, e-mail:> users-help@httpd.apache.org>
_________________________________________________________ ÅμƽX¬Û¨C±i¥u«Y $1.2¡I Print your digital photos for $1.2 each only http://photos.yahoo.com.hk
#!d:\perl\bin\perl.exe -w # Setup Begin $|=1; print "Content-type: text/plain\r\n\r\n";
$bgcolor = "eeeecc"; # color of background $text = "000000"; # color of text #End of Setup ####################### print "Content-type: text/html\n"; print "Pragma:no-cache\n\n";
{ local ($oldbar) = $|; $cfh = select (STDOUT); $| = 1; # # print your HTTP headers here # $| = $oldbar; select ($cfh); } e"t_data; &set_var;
($nsec,$nmin,$nhour,$nday,$nmon,$nyear,$wday,$yday,$isdst) = localtime(time+($time_miss*3600)); $nmon++; if ($nmon<10) {$nmon="0$nmon";} if ($nday<10) {$nday="0$nday";} if ($nhour<10){$nhour="0$nhour";} if ($nmin<10) {$nmin="0$nmin";} if ($nsec<10) {$nsec="0$nsec";} $normal_time = "$nyear/$nmon/$nday($nhour\nmin)"; $userhost = $ENV{'REMOTE_HOST'}; } ##################### sub get_new_number { open(MAIN,"$numberfile") || die $!; $number = <MAIN>; close(MAIN);
$number=int($number)+1;
open(MAIN,">$numberfile") || die $!; print MAIN "$number"; close(MAIN); } ##################### sub write_main { $write_main_subject = $_[0];
open(MAIN,"$mainfile") || die $!; @main = <MAIN>; close(MAIN);
if ($write_main_subject eq "add") {
open(MAIN,">$mainfile") || die $!; foreach $main_line (@main) { if ($main_line =~ /<!--begin-->/) { print MAIN "<!--begin-->\n"; print MAIN "<!--number=$number--head-->\n"; print MAIN "<font size=3>"; print MAIN "<img src=$ledgifurl>$says<br>"; print MAIN "</font>\n"; print MAIN "<font size=2><i><b>"; print MAIN "By $username "; if ($usermail) { print MAIN "E-mail\:<a href=\"mailtousermail\">$usermail</a>"; } print MAIN "<br>"; if ($userurl){ print MAIN "Url\:<a href=\"$userurl\" target=\"windows\">$userurl</a><br>"; } print MAIN "</b></i></font>"; print MAIN "<font size=1><i>At\normal_time Host\userhost</i></font>"; print MAIN "<hr width=400 align=left size=1>\n"; print MAIN "<!--number=$number--end-->\n"; } else { print MAIN "$main_line"; } } close(MAIN);
} elsif ($write_main_subject eq "managedel") { $temp=1; open(MAIN,">$mainfile") || die $!; foreach $main_line (@main) { if ($main_line =~ /<!--number=$number--head-->/) { $temp=2; print MAIN ""; } elsif ($main_line =~ /<!--number=$number--end-->/) { $temp=3; print MAIN ""; } elsif ($temp==2) { print MAIN ""; } else { print MAIN "$main_line"; } } close(MAIN); }
}
############ sub return_request { $return_request_subject = $_[0];
open(MAIN,"$mainfile") || die $!; @main = <MAIN>; close(MAIN);
--------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org
I had to reinstall windows 2000 on my machine for some funny reasons and hence am now setting up my webserver and other things. I installed Apache 1.3.27 and that works fine. I then downloaded PHP4 and was trying to configure it to the Apache web server. I followed all instructions in the instalation guide, but still get this error when I try to run any php scripts from the browser: "Premature end of script headers: c:/php/php.exe"
Any idea why this would happen? And how to correct it?
thanks, Prachi.
__________________________________________________ Do you Yahoo!? New DSL Internet Access from SBC & Yahoo! http://sbc.yahoo.com
Alexey Lysenkov 19 December 2002 02:53:32 [ permanent link ]
Guys? The support guy says that my php-script brings his php interpreter to crash. I am astonished (wow-what a powerful man I am ) - no, but really, it doesn't crash MY server? He also said, it happens just right after the file is being asked for, that is, as I suspect, somewhere in the first lines of my php code. I run 4.2.0, he runs 4.0.5 . Both Safe-mode "on", both, as I suspect, on Windows, mySQL as well. What could in these first lines of the code, which follows, bring his machine to death? Please, someone - it's so urgent, really...
Guys? The support guy says that my php-script brings his php interpreter to>crash. I am astonished (wow-what a powerful man I am ) - no, but really,>it doesn't crash MY server? He also said, it happens just right after the>file is being asked for, that is, as I suspect, somewhere in the first lines>of my php code.
Interesting...
I run 4.2.0, he runs 4.0.5 . Both Safe-mode "on", both, as I suspect, on>Windows, mySQL as well.
you suspect he is on winodws or know he is? (No experience with the windows platform and PHP myself)
What could in these first lines of the code, which follows, bring his>machine to death? Please, someone - it's so urgent, really...>
<?php
^^^^^^ is there a space above this line? For perl etc cgi scripts, having a space above the hash causes this error... might be something to check especially when you are expecting to set cookie, session and other header related stuff, maybe he is running as a CGI or something and causing this.
Barring that, try eliminating/commenting out chunks of code until you get the page to at least load in some state, then start putting back untlil you narrow down where the problem is. Perhaps increase your error reporting... stabbing here.
Dominik Luyten 14 January 2003 00:03:34 [ permanent link ]
Hi all,
I need to switch from Active Perl 5.6 to 5.8 on Windows as dbd-mysql only supports on 5.8
So I uninstalled 5.6 and installed 5.8 with dbi and dbd-mysql modules. I changed nothing else, even used the same directory as before for the Perl installation, but i get "Premature end of script headers" now.
I am sure it is some configuration "feature" of 5.8, as everything works fine with 5.6
Basil Daoust 14 January 2003 00:16:44 [ permanent link ]
I don't know what your problem is but 5.8 and 5.6.1 do behave differently. As I tried to install 5.8 and it broke my script I was working on. So try checking the change log text, it might shine some light on your problem.
So I uninstalled 5.6 and installed 5.8 with dbi and dbd-mysql modules. I> changed nothing else, even used the same directory as before for the> Perl installation, but i get "Premature end of script headers" now.>
I am sure it is some configuration "feature" of 5.8, as everything works> fine with 5.6
I thought you said you couldn't even run (whatever program this is) on 5.6?
It sounds like a problem with your webserver to me. Did you try running your program from a command prompt and seeing what the output was? And then running a "Hello, World" script through the server?
Cameron
-- Cameron Dorey Associate Professor of Chemistry University of Central Arkansas Phone: 501-450-5938 camerond@mail.uca.edu
Dominik Luyten 14 January 2003 00:26:47 [ permanent link ]
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi Cameron,
sorry for the error! What I wanted to say was : "I need to switch from Active Perl 5.6 to 5.8 on Windows as dbd-mysql only supports TRANSACTIONS on 5.8" (dbd-mysql supports transactions only from version > 2.xxx which does not seem to work with 5.6, i.e. I did not happen to find a runnable version of it)
It runs well on 5.6, but without transaction support, and does not run on 5.8 at all.
Cameron Dorey wrote: | Dominik Luyten wrote: | |> Hi all, |> |> I need to switch from Active Perl 5.6 to 5.8 on Windows as dbd-mysql |> only supports on 5.8 | | | | I'm using it on 5.6, so you must have made some mistake. | | http://www.activestate.com/PPMPackages/zips/6xx-builds-only/DBD-Mysql.zip | | to get your own copy to install it locally. | |> |> So I uninstalled 5.6 and installed 5.8 with dbi and dbd-mysql modules. I |> changed nothing else, even used the same directory as before for the |> Perl installation, but i get "Premature end of script headers" now. |> |> I am sure it is some configuration "feature" of 5.8, as everything works |> fine with 5.6 | | | | I thought you said you couldn't even run (whatever program this is) on 5.6? | | It sounds like a problem with your webserver to me. Did you try running | your program from a command prompt and seeing what the output was? And | then running a "Hello, World" script through the server? | | Cameron |
-----BEGIN PGP SIGNATURE----- Version: PGP 6.5.8 Comment: Using PGP with Mozilla - http://enigmail.mozdev.org