Re: mod_perl headers
Perrin Harkins wrote: Cure wrote: I know --> I submit the headers but why does it show the headers on the browser, doesn't that mean the headers wre submitted twice ? Why don't you take a look at the raw output (with LWP's GET script or something) and see? I misread your question before -- apache does send a hardcoded message with headers by default when your program crashes. In your case, you have also sent some headers but I think those will be buffered while the error headers will not, causing the effect that you're seeing. I can't advise you about why CGI::Carp isn't working for you. It might be caused by you already having sent some output at the time your script died. People often complain about CGI::Carp problems, so it seems to be a pretty fragile module. You can see some other people's discussions about it in the mailing list archives. They might have possible solutions for you. - Perrin Thxs Perrin Cure
Re: mod_perl headers
Cure wrote: I know --> I submit the headers but why does it show the headers on the browser, doesn't that mean the headers wre submitted twice ? Why don't you take a look at the raw output (with LWP's GET script or something) and see? I misread your question before -- apache does send a hardcoded message with headers by default when your program crashes. In your case, you have also sent some headers but I think those will be buffered while the error headers will not, causing the effect that you're seeing. I can't advise you about why CGI::Carp isn't working for you. It might be caused by you already having sent some output at the time your script died. People often complain about CGI::Carp problems, so it seems to be a pretty fragile module. You can see some other people's discussions about it in the mailing list archives. They might have possible solutions for you. - Perrin
Re: mod_perl headers
and I used use CGI::Carp qw(fatalsToBrowser) in my script. It still didn't print the error to the browser Cure Perrin Harkins wrote: Cure wrote: Does Apache submit headers when a error occurs ? No. You sent the headers with your send_http_header command. Mason doesn't have this issue because it waits and builds up the entire output in a string before it sends any headers out. You can do the same in your script if you want to. Take a look at http://perl.apache.org/docs/1.0/guide/snippets.html#Redirecting_Errors_to_the_Client_Instead_of_error_log for more info on these issues. $r->('HI'); That's not a method of $r. Don't do that. - Perrin
Re: mod_perl headers
Perrin Harkins wrote: Cure wrote: Does Apache submit headers when a error occurs ? No. You sent the headers with your send_http_header command. Mason doesn't have this issue because it waits and builds up the entire output in a string before it sends any headers out. You can do the same in your script if you want to. Take a look at http://perl.apache.org/docs/1.0/guide/snippets.html#Redirecting_Errors_to_the_Client_Instead_of_error_log for more info on these issues. $r->('HI'); That's not a method of $r. Don't do that. - Perrin I had $r->print('HI') in my script. I made a typo when typing into this document. I know --> I submit the headers but why does it show the headers on the browser, doesn't that mean the headers wre submitted twice ? error --> hiHTTP/1.1 200 OK Date: Mon, 03 Mar 2003 04:34:04 GMT Server: Apache/1.3.26 (Win32) mod_perl/1.27_01-dev Connection: close Transfer-Encoding: chunked Content-Type: text/html; charset=iso-8859-1 OK The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [EMAIL PROTECTED] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log.
Re: mod_perl headers
Cure wrote: Does Apache submit headers when a error occurs ? No. You sent the headers with your send_http_header command. Mason doesn't have this issue because it waits and builds up the entire output in a string before it sends any headers out. You can do the same in your script if you want to. Take a look at http://perl.apache.org/docs/1.0/guide/snippets.html#Redirecting_Errors_to_the_Client_Instead_of_error_log for more info on these issues. $r->('HI'); That's not a method of $r. Don't do that. - Perrin
Re: mod_perl headers
Ged Haywood wrote: Hi there, On Sun, 2 Mar 2003, Cure wrote: Does Apache submit headers when a error occurs ? Trying to display an error message to the browser. I use mason for the web, so if I have die() statement in my code mason will display the error to the browser. If I use an Apache handler -> the error doesn't get displayed to the screen, not sure why. It seems apache submits headers along with my headers when an error occurs. Have you checked in the mod_perl Guide? There are several sections related to sending headers, you'll probably find your answer in there. Have you got 'PerlSendHeader ON' in your configuration somewhere? 73, Ged. Have you got 'PerlSendHeader ON' in your configuration somewhere? answer:<--- NO Cure
Re: mod_perl headers
Hi there, On Sun, 2 Mar 2003, Cure wrote: > Does Apache submit headers when a error occurs ? > Trying to display an error message to the browser. > > I use mason for the web, so if I have die() statement in my code > mason will display the error to the browser. > > If I use an Apache handler -> the error doesn't get displayed to the screen, > not sure why. It seems apache submits headers along with my headers when > an error occurs. Have you checked in the mod_perl Guide? There are several sections related to sending headers, you'll probably find your answer in there. Have you got 'PerlSendHeader ON' in your configuration somewhere? 73, Ged.
mod_perl headers
Does Apache submit headers when a error occurs ? Trying to display an error message to the browser. I use mason for the web, so if I have die() statement in my code mason will display the error to the browser. If I use an Apache handler -> the error doesn't get displayed to the screen, not sure why. It seems apache submits headers along with my headers when an error occurs. My error message on my browser ---> ## hiHTTP/1.1 200 OK Date: Mon, 03 Mar 2003 04:34:04 GMT Server: Apache/1.3.26 (Win32) mod_perl/1.27_01-dev Connection: close Transfer-Encoding: chunked Content-Type: text/html; charset=iso-8859-1 OK The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [EMAIL PROTECTED] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Apache/1.3.26 Server at localhost Port 80 ## The following code that purpose the error --> package Apache::G; use CGI::Carp qw/fatalsToBrowser/; use Apache::Constants qw(:common); sub handler () { my $r = shift; $r->send_http_header('text/html'); $r->('HI'); die("Oh No"); return OK; } 1;