You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Jeff Boes <jb...@nexcerpt.com> on 2003/10/15 23:04:06 UTC
Blank output after 5.8.1 upgrade?
We moved our webserver from a machine where mod_perl was built under
Perl 5.6.1, to a server where it was built under 5.8.1. Now, Perl
scripts run but produce no browser output!
For example:
------------begin code---------
#! /usr/bin/perl -w
open (TMP,">/tmp/hello.log") or die $!;
print TMP "See, I did run.\n";
open(STDOUT,'>- :stdio') or die $!;
print "Content-type: text/html
hello, world.
";
print TMP "And I'm still running.\n";
close TMP or die $!;
-----------end code------------
This code runs, and produces output in the /tmp directory. But all I get
in my browser is a blank page and a "Done."
--
Jeff Boes vox 269.226.9550 ext 24
Database Engineer fax 269.349.9076
Nexcerpt, Inc. http://www.nexcerpt.com
...Nexcerpt... Extend your Expertise
Re: Blank output after 5.8.1 upgrade?
Posted by Jeff Boes <jb...@nexcerpt.com>.
Jeff Boes wrote:
> Stas Bekman wrote:
>
>>
>> You are running under mod_perl 1.0, right? Can we see the output of
>> perl -V? Anything in the error_log?
>>
Here's the -V output from the script running under mod_perl (thanks,
Rafael!):
Summary of my perl5 (revision 5.0 version 8 subversion 1) configuration:
Platform:
osname=linux, osvers=2.4.18-18.7.xsmp, archname=i686-linux
uname='linux xifos.nexcerpt.com 2.4.18-18.7.xsmp #1 smp wed nov 13
19:01:42 est 2002 i686 unknown '
config_args=''
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-fno-strict-aliasing -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
optimize='-O2',
cppflags='-fno-strict-aliasing -I/usr/local/include -I/usr/include/gdbm'
ccversion='', gccversion='2.96 20000731 (Red Hat Linux 7.3
2.96-113)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lndbm -lgdbm -ldl -lm -lcrypt -lutil -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
libc=/lib/libc-2.2.5.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.2.5'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
--
Jeff Boes vox 269.226.9550 ext 24
Database Engineer fax 269.349.9076
Nexcerpt, Inc. http://www.nexcerpt.com
...Nexcerpt... Extend your Expertise
Re: Blank output after 5.8.1 upgrade?
Posted by Geoffrey Young <ge...@modperlcookbook.org>.
Rafael Garcia-Suarez wrote:
> Jeff Boes wrote:
>
>>And here's what perl -V produces from the command line (is there a way
>>to do an equivalent thing from within a mod_perl script?):
>
>
> use Config qw/myconfig/;
> print myconfig;
there's also Apache::Status (included in the mod_perl distribution), which
is useful for displaying perl -V, %ENV, and more from the runtime environment.
HTH
--Geoff
Re: Blank output after 5.8.1 upgrade?
Posted by Rafael Garcia-Suarez <ra...@hexaflux.com>.
Jeff Boes wrote:
> And here's what perl -V produces from the command line (is there a way
> to do an equivalent thing from within a mod_perl script?):
use Config qw/myconfig/;
print myconfig;
Re: Blank output after 5.8.1 upgrade?
Posted by Jeff Boes <jb...@nexcerpt.com>.
Well, in parallel with my investigations our sysadmin was looking at
upgrading mod_perl itself. He rebuilt it as V1.29 (still with Perl
5.8.1) and all the problems went away! So, while we can no longer tell
anyone just what was wrong, we can at least recommend a way to escape
the swamp ...
--
Jeff Boes vox 269.226.9550 ext 24
Database Engineer fax 269.349.9076
Nexcerpt, Inc. http://www.nexcerpt.com
...Nexcerpt... Extend your Expertise
Re: Blank output after 5.8.1 upgrade?
Posted by Stas Bekman <st...@stason.org>.
Jeff Boes wrote:
> Stas Bekman wrote:
>
>>>> Jeff Boes wrote:
>>>>
>>>>> We moved our webserver from a machine where mod_perl was built
>>>>> under Perl 5.6.1, to a server where it was built under 5.8.1. Now,
>>>>> Perl scripts run but produce no browser output!
>>>>>
>> You mean a simple script:
>>
>> print "Content-type: text/plain\n\n";
>> print "Hello";
>>
>> doesn't output "Hello"?
>>
>> You are running under mod_perl 1.0, right? Can we see the output of
>> perl -V? Anything in the error_log?
>>
>
> Yes, that's correct -- even the most basic script produces a blank page.
I don't trust that "blank page" statement, are you sure that there is no
output or is that just the browser can't interpret the output? What happens if
you use a command line tool:
lynx -dump -mime_header http://localhost:8000/perl/test.pl
(or whatever the URL was). I also assume that you have the 'PerlSendHeader On'
in your config. Can we see the relevant httpd.conf section?
If nothing is printed next try with the following script:
my $r = shift;
$r->send_http_header("text/plain");
$r->print("Hello");
> I believe my mod_perl version is "1.27" (see MOD_PERL environment
> variable in listing below).
It's 1.26 according to the MOD_PERL environment variable you printed.
> Nothing in any log files that I can find. As previously noted, if I
> insert an open() to my /tmp directory and write to a file there, I can
> show that the script is actually running.
There aren't "any" log files, you want to find the error_log file and see what
it says. You could add:
warn "I'm running";
to your script and you should see that printed into the error_log file, you
don't need to use special tricks to check that the script was executed.
Finally show me what's added to the access_log file, when you issue a request.
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Blank output after 5.8.1 upgrade?
Posted by Jeff Boes <jb...@nexcerpt.com>.
Stas Bekman wrote:
>>> Jeff Boes wrote:
>>>
>>>> We moved our webserver from a machine where mod_perl was built
>>>> under Perl 5.6.1, to a server where it was built under 5.8.1. Now,
>>>> Perl scripts run but produce no browser output!
>>>>
> You mean a simple script:
>
> print "Content-type: text/plain\n\n";
> print "Hello";
>
> doesn't output "Hello"?
>
> You are running under mod_perl 1.0, right? Can we see the output of
> perl -V? Anything in the error_log?
>
Yes, that's correct -- even the most basic script produces a blank page.
I believe my mod_perl version is "1.27" (see MOD_PERL environment
variable in listing below).
Nothing in any log files that I can find. As previously noted, if I
insert an open() to my /tmp directory and write to a file there, I can
show that the script is actually running.
I've dumped the %ENV hash from such a script:
AUTH_TYPE: Basic
DOCUMENT_ROOT: /web/nexcerpt/html
GATEWAY_INTERFACE: CGI-Perl/1.1
HTTP_ACCEPT:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1
HTTP_ACCEPT_CHARSET: ISO-8859-1,utf-8;q=0.7,*;q=0.7
HTTP_ACCEPT_ENCODING: gzip,deflate
HTTP_ACCEPT_LANGUAGE: en-us,en;q=0.5
HTTP_CONNECTION: keep-alive
HTTP_HOST: xservice.nexcerpt.com
HTTP_KEEP_ALIVE: 300
HTTP_USER_AGENT: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5)
Gecko/20030925
MOD_PERL: mod_perl/1.26
PATH: /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
PERL5LIB: /home/nexcerpt/
QUERY_STRING:
REMOTE_ADDR: 64.147.202.1
REMOTE_PORT: 33095
REMOTE_USER: jboes
REQUEST_METHOD: GET
REQUEST_URI: /hello.pl
SCRIPT_FILENAME: /web/nexcerpt/html/hello.pl
SCRIPT_NAME: /hello.pl
SERVER_ADDR: 64.147.202.13
SERVER_ADMIN: webmaster@nexcerpt.com
SERVER_NAME: xservice.nexcerpt.com
SERVER_PORT: 80
SERVER_PROTOCOL: HTTP/1.1
SERVER_SIGNATURE:
SERVER_SOFTWARE: Apache/1.3.27 (Unix) (Red-Hat/Linux) mod_ssl/2.8.12
OpenSSL/0.9.6b DAV/1.0.3 PHP/4.1.2 mod_perl/1.26 mod_auth_pgsql/0.9.12
mod_throttle/3.1.2
And here's what perl -V produces from the command line (is there a way
to do an equivalent thing from within a mod_perl script?):
Summary of my perl5 (revision 5.0 version 8 subversion 1) configuration:
Platform:
osname=linux, osvers=2.4.18-18.7.xsmp, archname=i686-linux
uname='linux xifos.nexcerpt.com 2.4.18-18.7.xsmp #1 smp wed nov 13
19:01:42 est 2002 i686 unknown '
config_args=''
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-fno-strict-aliasing -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
optimize='-O2',
cppflags='-fno-strict-aliasing -I/usr/local/include -I/usr/include/gdbm'
ccversion='', gccversion='2.96 20000731 (Red Hat Linux 7.3
2.96-113)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lndbm -lgdbm -ldl -lm -lcrypt -lutil -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
libc=/lib/libc-2.2.5.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.2.5'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: USE_LARGE_FILES
Built under linux
Compiled at Oct 7 2003 09:59:16
%ENV:
PERL5LIB="/home/nexcerpt"
@INC:
/home/nexcerpt
/usr/local/lib/perl5/5.8.1/i686-linux
/usr/local/lib/perl5/5.8.1
/usr/local/lib/perl5/site_perl/5.8.1/i686-linux
/usr/local/lib/perl5/site_perl/5.8.1
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux
/usr/local/lib/perl5/site_perl/5.8.0
/usr/local/lib/perl5/site_perl/5.6.1
/usr/local/lib/perl5/site_perl
.
--
Jeff Boes vox 269.226.9550 ext 24
Database Engineer fax 269.349.9076
Nexcerpt, Inc. http://www.nexcerpt.com
...Nexcerpt... Extend your Expertise
Re: Blank output after 5.8.1 upgrade?
Posted by Stas Bekman <st...@stason.org>.
Jeff Boes wrote:
> Stas Bekman wrote:
>
>> Jeff Boes wrote:
>>
>>> We moved our webserver from a machine where mod_perl was built under
>>> Perl 5.6.1, to a server where it was built under 5.8.1. Now, Perl
>>> scripts run but produce no browser output!
>>>
> <snip>
>
>>> open(STDOUT,'>- :stdio') or die $!;
>>>
>>> This code runs, and produces output in the /tmp directory. But all I
>>> get in my browser is a blank page and a "Done."
>>
>>
>>
>> I suppose that it's only scripts that reopen STDOUT to :stdio have
>> this problem, right? why do you reopen STDOUT? It's already tied to
>> the client's socket when you run under mod_perl. why :stdio?
>
>
> Sorry; I meant to illustrate my problem with my original example, but
> managed to paste in a later result. The re-open has *no* effect when
> running under mod_perl (I think); I get a blank page regardless of
> whether this is here or not.
You mean a simple script:
print "Content-type: text/plain\n\n";
print "Hello";
doesn't output "Hello"?
You are running under mod_perl 1.0, right? Can we see the output of perl -V?
Anything in the error_log?
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Blank output after 5.8.1 upgrade?
Posted by Jeff Boes <jb...@nexcerpt.com>.
Stas Bekman wrote:
> Jeff Boes wrote:
>
>> We moved our webserver from a machine where mod_perl was built under
>> Perl 5.6.1, to a server where it was built under 5.8.1. Now, Perl
>> scripts run but produce no browser output!
>>
<snip>
>> open(STDOUT,'>- :stdio') or die $!;
>>
>> This code runs, and produces output in the /tmp directory. But all I
>> get in my browser is a blank page and a "Done."
>
>
> I suppose that it's only scripts that reopen STDOUT to :stdio have
> this problem, right? why do you reopen STDOUT? It's already tied to
> the client's socket when you run under mod_perl. why :stdio?
Sorry; I meant to illustrate my problem with my original example, but
managed to paste in a later result. The re-open has *no* effect when
running under mod_perl (I think); I get a blank page regardless of
whether this is here or not.
--
Jeff Boes vox 269.226.9550 ext 24
Database Engineer fax 269.349.9076
Nexcerpt, Inc. http://www.nexcerpt.com
...Nexcerpt... Extend your Expertise
Re: Blank output after 5.8.1 upgrade?
Posted by Stas Bekman <st...@stason.org>.
Jeff Boes wrote:
> We moved our webserver from a machine where mod_perl was built under
> Perl 5.6.1, to a server where it was built under 5.8.1. Now, Perl
> scripts run but produce no browser output!
>
> For example:
>
> ------------begin code---------
> #! /usr/bin/perl -w
> open (TMP,">/tmp/hello.log") or die $!;
> print TMP "See, I did run.\n";
> open(STDOUT,'>- :stdio') or die $!;
> print "Content-type: text/html
>
> hello, world.
> ";
> print TMP "And I'm still running.\n";
> close TMP or die $!;
>
> -----------end code------------
>
> This code runs, and produces output in the /tmp directory. But all I get
> in my browser is a blank page and a "Done."
I suppose that it's only scripts that reopen STDOUT to :stdio have this
problem, right? why do you reopen STDOUT? It's already tied to the client's
socket when you run under mod_perl. why :stdio?
Interesting, but the command line test produces an opposite result:
/tmp> perl-5.8.1 -wle "open STDOUT, '>- :stdio' or die $!; print 1"
1
/tmp> perl-5.8.0 -wle "open STDOUT, '>- :stdio' or die $!; print 1"
1
/tmp> perl-5.6.1 -wle "open STDOUT, '>- :stdio' or die $!; print 1"
/tmp> perl-5.6.0 -wle "open STDOUT, '>- :stdio' or die $!; print 1"
so here 5.8 works, but not 5.6.
Besides 5.6 has no idea what :stdio is, dunno why open doesn't complain:
/tmp> perl-5.6.0 -wle "binmode STDOUT, ':stdio'; print 1"
Unknown discipline ':stdio' at -e line 1.
/tmp> perl-5.6.1 -wle "binmode STDOUT, ':stdio'; print 1"
Unknown discipline ':stdio' at -e line 1.
/tmp> perl-5.8.1 -wle "binmode STDOUT, ':stdio'; print 1"
Segmentation fault
/tmp> perl-5.8.0 -wle "binmode STDOUT, ':stdio'; print 1"
1
/tmp> perl-blead -wle "binmode STDOUT, ':stdio'; print 1"
Segmentation fault
Heh, segfault in 5.8.1/5.9.0-tobe, I'll report that to p5p.
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com