Re: $r->status no correct

2008-10-30 Thread Michael Peters
Geoffrey Young wrote: I'd check your logs but the common log format uses %>s. try $r->last->status() Aha! That's it, thanks a lot Geoff! -- Michael Peters Plus Three, LP

Re: $r->status no correct

2008-10-29 Thread Geoffrey Young
Michael Peters wrote: > Ryan Gies wrote: > >> Below is an Apache log snippet which traces the handler phases for two >> requests: >> >> A) /scratch/ does NOT have a directory index >> B) /scratch/foo/ DOES have a directory index (index.html) > > So here is mine (the text for die

Re: $r->status no correct

2008-10-29 Thread Ryan Gies
CORRECTIONS! On Wed, 29 Oct 2008 15:30:12 -0700 Ryan wrote: > I tested a PHP script with a syntax error, and I see exactly what > you're seeing. No, my test was not valid. $r->status will be 500 when the PHP script issues: header('HTTP/1.0 500 Error'); > From Apache2::RequestRec documentation

Re: $r->status no correct

2008-10-29 Thread Ryan Gies
On Wed, 29 Oct 2008 17:51:54 -0400 Michael wrote: > So "/foo/" goes through some extra steps (lines 2-7) but after that > it looks the same as "/foo/index.pl" until you hit the die(). Then > the status for "/foo/index.pl" goes to 500 while the status for > "/foo" stays at 200. I tested a PHP scri

Re: $r->status no correct

2008-10-29 Thread Michael Peters
Ryan Gies wrote: Below is an Apache log snippet which traces the handler phases for two requests: A) /scratch/ does NOT have a directory index B) /scratch/foo/ DOES have a directory index (index.html) So here is mine (the text for die() is "A horrible, terrible death!") A) /f

Re: $r->status no correct

2008-10-29 Thread Michael Peters
Adam Prime wrote: You should package that up and put it on CPAN. Attached is a version that works on mod_perl 1. -- Michael Peters Plus Three, LP package Apache::Trace; use strict; use Apache::Log(); use Apache::Constants ':common'; our @Phases = qw( PerlPostReadRequestHandler PerlTrans

Re: $r->status no correct

2008-10-29 Thread Adam Prime
Ryan Gies wrote: Not a permanent home, but here is module which will slip in and give you similar messages. http://dev.livesite.net/Apache-Trace.pm just put it in a dirctory named 'Apache2' in your @INC and add: PerlPostReadRequestHandler Apache2::Trace->http_phases You should package

Re: $r->status no correct

2008-10-29 Thread Ryan Gies
On Wed, 29 Oct 2008 16:51:51 -0400 Michael wrote: > This is probably a really dumb question, but how do you get a log > like that? I tried setting "LogLevel debug" but no dice. Not a permanent home, but here is module which will slip in and give you similar messages. http://dev.livesite.net/Ap

Re: $r->status no correct

2008-10-29 Thread Michael Peters
Ryan Gies wrote: Below is an Apache log snippet which traces the handler phases for two requests: This is probably a really dumb question, but how do you get a log like that? I tried setting "LogLevel debug" but no dice. -- Michael Peters Plus Three, LP

Re: $r->status no correct

2008-10-29 Thread Michael Peters
Michael Peters wrote: No, I just get URI: /foo/ STATUS: 200 Nothing else. The browser get's a 500 and the access log reports 500, but the actual request gets a 200. I even tried it from a log handler just to see if I get the same thing. Does it matter that I'm using Apache::Registry to pro

Re: $r->status no correct

2008-10-29 Thread Ryan Gies
On Wed, 29 Oct 2008 16:13:32 -0400 Michael wrote: > Ok then let's talk about "/foo/" and "/foo/index.pl" so that we're > not talking about the redirect. Right on > if it was subrequests that were the problem I would have expected to > see more than debug statement in the log since the cleanup ha

Re: $r->status no correct

2008-10-29 Thread Michael Peters
Adam Prime wrote: Just to be clear, when you do this: GET /foo/ do you get this in the error log? URI: /foo/index.pl STATUS: 500 (the sub request from Directory Index) URI: /foo/ STATUS: 200 (the original request) No, I just get URI: /foo/ STATUS: 200 Nothing else. The browser get's a 500

Re: $r->status no correct

2008-10-29 Thread Adam Prime
Michael Peters wrote: The client always sees the 500 which is what the access log reports as well. It's just that in the CleanupHandler it comes back as 200 for /foo/, but 500 for /foo/index.pl. Just to be clear, when you do this: GET /foo/ do you get this in the error log? URI: /foo/ind

Re: $r->status no correct

2008-10-29 Thread Michael Peters
Ryan Gies wrote: On Wed, 29 Oct 2008 15:29:18 -0400 Michael wrote: So what's going on here. Shouldn't the 2 requests (/foo and /foo/index.pl) be treated exactly the same? /foo is much different than /foo/index.pl because /foo is handled by mod_dir (http://httpd.apache.org/docs/2.0/mod/mod_dir

Re: $r->status no correct

2008-10-29 Thread Adam Prime
Michael Peters wrote: The client always sees the 500 which is what the access log reports as well. It's just that in the CleanupHandler it comes back as 200 for /foo/, but 500 for /foo/index.pl. That really is strange. Perhaps the status is getting mangled at the end of the Log phase or some

Re: $r->status no correct

2008-10-29 Thread Ryan Gies
On Wed, 29 Oct 2008 15:29:18 -0400 Michael wrote: > So what's going on here. Shouldn't the 2 requests (/foo > and /foo/index.pl) be treated exactly the same? /foo is much different than /foo/index.pl because /foo is handled by mod_dir (http://httpd.apache.org/docs/2.0/mod/mod_dir.html). First, t

Re: $r->status no correct

2008-10-29 Thread Michael Peters
Adam Prime wrote: Michael Peters wrote: But when I make the request to just /foo (instead of /foo/index.pl) I only get this in my error log: URI: /foo/ STATUS: 200 you've said to /foo, but your error_log is saying /foo/. What's going on there? mod_dir redirecting a bare directory request?

Re: $r->status no correct

2008-10-29 Thread Adam Prime
Michael Peters wrote: But when I make the request to just /foo (instead of /foo/index.pl) I only get this in my error log: URI: /foo/ STATUS: 200 you've said to /foo, but your error_log is saying /foo/. What's going on there? mod_dir redirecting a bare directory request? The stranger par

$r->status no correct

2008-10-29 Thread Michael Peters
I've been banging my head against on wall on this one and could use a little help. Setting the Stage: I've got an Apache::CleanupHandler that is running for my requests. I've got a file at DocumentRoot/foo/index.pl and DirectoryIndex index.pl. Now, to test out error handling in my cleanup hand