On Mon, 20 Sep 2004, Andrew Brosnan wrote:

> However, even though it appears that mod_perl is loaded, I can't get
> mod_perl scripts to run. 

This had been driving me nuts for months, and I finally figured it out 
this weekend. I posted a message a while back about Apache::MP3 not 
working, but wasn't able to find a fix at the time -- now it works, too.

A fuller description is on my web site (see below), but basically, for 
reasons I'm not clear on, mod_perl isn't grabbing stdout from scripts, 
which means they go through the motions of working, normal activity 
shows up in the access log (and nothing in the error log), but nothing 
ever shows up in the browser.

The interesting test is to telnet to the web port of your server and 
manually request a mod_perl controlled document:

 -> $ telnet localhost 80
    Trying 127.0.0.1...
    Connected to my-tester
    Escape character is '^]'.
 -> GET /perl/test HTTP/1.0
 ->
    $

Or something like that -- no data at all comes back.

The fix is to tie STDOUT to Apache in your script --

    tie *STDOUT, 'Apache';

-- or do the same in your httpd.conf --

    PerlHeaderParserHandler "sub { tie *STDOUT, 'Apache' unless tied *STDOUT; }"

I'm still not clear what, exactly, the bug is that is causing this 
(simply a bad build that got shipped?), but in any event the mechanism 
makes sense, and the way to fix it is clear.

Give that a try & let me know if it doesn't work.


This ought to be in a prominent Perl/OSX10.3 FAQ somewhere... :-/


Longer version of the above, with links & references, etc:

    <http://devers.homeip.net:8080/blog/archives/000064.html>



-- 
Chris Devers

Reply via email to