Mailing List Archive

problem using PerlRequire ?
I'm trying to use apache and mod_perl, and am running into problems
when I add to apache.conf:

PerlRequire conf/startup.pl
PerlFreshRestart On

_and_ conf/startup.pl contains:

# commonly used modules
use Apache::Registry();
use Apache::Constants();
use CGI qw(-compile :all);
use CGI::Carp ();

use DBI; # works if these two lines are commented out
use GD;

1;

With DBI and GD commented out, this works fine. As in,
logs/error_log says that mod_perl has started fine, and CGI scripts
which use DBI and GD run fine under mod_perl and Apache::Registry.
With "use DBI; use GD;" in "conf/startup.pl", logs/error_log says that
mod_perl has started fine, but when I try to retrieve the main
"powered by Apache" page, the error log shows child processes
segfaulting (and the browser says "document contains no data.")
Also, when I put "PerlRequire DBI" in httpd.conf, it complains:

[Tue Feb 15 11:29:07 2000] [error] DBI did not return a true value at (eval 3) line 1.

Syntax error on line 875 of /usr/local/apache/conf/httpd.conf:
DBI did not return a true value at (eval 3) line 1.

/usr/local/apache/bin/apachectl start: httpd could not be started

The gory details of what I'm using:
- Red Hat Linux 6.1, kernel version 2.2.12-20
- Perl 5.00503
- Apache 1.3.9 and mod_perl 1.19, built from source using the recipe
in the mod_perl developer's guide:

% perl Makefile.PL APACHE_SRC=../apache_x.x.x/src \
DO_HTTPD=1 USE_APACI=1 EVERYTHING=1
% make && make test && make install
% cd ../apache_x.x.x
% make install

I've also had the same problem using Apache 1.3.9 and mod_perl 1.21,
also built from source.
I've also tried some combinations of binary RPMs: namely,
Apache 1.3.9 and mod_perl 1.21, and
Apache 1.3.6 and mod_perl 1.19.

Note that some Apache and CGI modules load fine in the "startup.pl"
file. As far as I know, these don't use native code. So, I'm
suspecting maybe some problem with mod_perl's loading of native code
on startup? (Printing the @INC array in "startup.pl" shows the
correct array in the correct place, as far as I can tell -- "DBI.pm"
is in the directory $INC[2]. )
As usual, sorry if I'm missing something obvious, and any help
would be appreciated.

Josh Burdick
jburdick@gradient.cis.upenn.edu
--
Josh Burdick
http://www.cis.upenn.edu/~jburdick
jburdick@gradient.cis.upenn.edu
Re: problem using PerlRequire ? [ In reply to ]
> I'm trying to use apache and mod_perl, and am running into problems
> when I add to apache.conf:
>
> PerlRequire conf/startup.pl


> PerlFreshRestart On
^^^^^^^^^^^^^^^^^^^

this one can cause you problems on the server *re*start.

> _and_ conf/startup.pl contains:
>
> # commonly used modules
> use Apache::Registry();
> use Apache::Constants();
> use CGI qw(-compile :all);
> use CGI::Carp ();
>
> use DBI; # works if these two lines are commented out
> use GD;
>
> 1;
>
> With DBI and GD commented out, this works fine. As in,
> logs/error_log says that mod_perl has started fine, and CGI scripts
> which use DBI and GD run fine under mod_perl and Apache::Registry.
> With "use DBI; use GD;" in "conf/startup.pl", logs/error_log says that
> mod_perl has started fine, but when I try to retrieve the main
> "powered by Apache" page, the error log shows child processes
> segfaulting (and the browser says "document contains no data.")
> Also, when I put "PerlRequire DBI" in httpd.conf, it complains:
>
> [Tue Feb 15 11:29:07 2000] [error] DBI did not return a true value at (eval 3) line 1.
>
> Syntax error on line 875 of /usr/local/apache/conf/httpd.conf:
> DBI did not return a true value at (eval 3) line 1.


Seems like a garbled DBI module, what happens when you run

perl -MDBI -e ''

I've replaced '1;' at the end of
/usr/lib/perl5/site_perl/5.005/i386-linux/DBI.pm with '0;' so I've gotten:

DBI.pm did not return a true value.
BEGIN failed--compilation aborted.

what happens when you do that?

Try to reinstall the DBI module...

>
> /usr/local/apache/bin/apachectl start: httpd could not be started
>
> The gory details of what I'm using:
> - Red Hat Linux 6.1, kernel version 2.2.12-20
> - Perl 5.00503
> - Apache 1.3.9 and mod_perl 1.19, built from source using the recipe
> in the mod_perl developer's guide:
>
> % perl Makefile.PL APACHE_SRC=../apache_x.x.x/src \
> DO_HTTPD=1 USE_APACI=1 EVERYTHING=1
> % make && make test && make install
> % cd ../apache_x.x.x
> % make install
>
> I've also had the same problem using Apache 1.3.9 and mod_perl 1.21,
> also built from source.
> I've also tried some combinations of binary RPMs: namely,
> Apache 1.3.9 and mod_perl 1.21, and
> Apache 1.3.6 and mod_perl 1.19.
>
> Note that some Apache and CGI modules load fine in the "startup.pl"
> file. As far as I know, these don't use native code. So, I'm
> suspecting maybe some problem with mod_perl's loading of native code
> on startup? (Printing the @INC array in "startup.pl" shows the
> correct array in the correct place, as far as I can tell -- "DBI.pm"
> is in the directory $INC[2]. )
> As usual, sorry if I'm missing something obvious, and any help
> would be appreciated.
>
> Josh Burdick
> jburdick@gradient.cis.upenn.edu
> --
> Josh Burdick
> http://www.cis.upenn.edu/~jburdick
> jburdick@gradient.cis.upenn.edu
>
>



_______________________________________________________________________
Stas Bekman mailto:sbekman@iname.com http://www.stason.org/stas
Perl,CGI,Apache,Linux,Web,Java,PC http://www.stason.org/stas/TULARC
perl.apache.org modperl.sourcegarden.org perlmonth.com perl.org
single o-> + single o-+ = singlesheaven http://www.singlesheaven.com