Bug 192485

Summary: CGI.pm doesn't work with mod_perl 1.99
Product: Red Hat Enterprise Linux 4 Reporter: Jonathan Schatz <jon>
Component: perlAssignee: Marcela Mašláňová <mmaslano>
Status: CLOSED CANTFIX QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: perl-maint-list, prockai
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-10-13 13:02:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jonathan Schatz 2006-05-20 00:57:14 UTC
Description of problem:

given a perl.conf in /etc/httpd/conf.d/ that has this line in it:

PerlRequire /etc/httpd/conf.d/startup.pl

and a /etc/httpd/conf.d/startup.pl with:

use CGI;
CGI->compile(':cgi');

CGI.pm won't compile. it fails with 

Starting httpd: [Fri May 19 17:59:26 2006] [error] Can't locate Apache.pm in
@INC (@INC contains: /var/www/html /var/www/html/mod_perl
/usr/lib/perl5/5.8.5/i386-linux-thread-multi /usr/lib/perl5/5.8.5
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.4/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.2/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4
/usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2
/usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.4/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.2/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.4
/usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl/5.8.2
/usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0
/usr/lib/perl5/vendor_perl /etc/httpd/ /etc/httpd/lib/perl) at
/usr/lib/perl5/5.8.5/CGI.pm line 196.\nCompilation failed in require at
/etc/httpd/conf.d/startup.pl line 16.\nBEGIN failed--compilation aborted at
/etc/httpd/conf.d/startup.pl line 16.\nCompilation failed in require at (eval 2)
line 1.\n
[Fri May 19 17:59:26 2006] [error] Can't load Perl file:
/etc/httpd/conf.d/startup.pl for server celebration.eng.vmware.com:0, exiting...

the actual error is in CGI.pm around line 190:


  if (exists $ENV{MOD_PERL_API_VERSION} && $ENV{MOD_PERL_API_VERSION} == 2) {
    $MOD_PERL = 2;
    require Apache2::Response;
    require Apache2::RequestRec;
    require Apache2::RequestUtil;
    require Apache2::RequestIO;
    require APR::Pool;
 } else {
   $MOD_PERL = 1;
    require Apache;
  }

the problem is, redhat's mod_perl is 1.99, so $ENV{MOD_PERL_API_VERSION} is not
2 (this maybe should be fixed in mod_perl instead of here, i'm not sure). so
CGI.pm tries to load Apache.pm (which doesn't exist). if i comment out the if
statement and the rest of the else block (ie, if i don't check the api version
and just use the Apache2::* modules), everything works as expected. 

Version-Release number of selected component (if applicable):
[root@celebration conf.d]$ rpm -q mod_perl perl
mod_perl-1.99_16-4
perl-5.8.5-24.RHEL4

Comment 1 Marcela Mašláňová 2008-08-14 13:42:01 UTC
I didn't reproduce at RHEL-4.6. Could you provide more info about version?

Comment 2 Marcela Mašláňová 2008-10-13 13:02:34 UTC
Since there are insufficient details provided in this report for us to investigate the issue further, and we have not received the feedback we requested, we will assume the problem was not reproduceable or has been fixed in a later update for this product.

Users who have experienced this problem are encouraged to upgrade to the latest update release, and if this issue is still reproduceable, please contact the Red Hat Global Support Services page on our website for technical support options: https://www.redhat.com/support