Strange INC error when using perl 5.8.0 as a cgi script

T

Tony

Hi All,

I have just compiled perl 5.8.0 on aix 4.3.3. I got the stable.tar
from cpan. It complied fine without any errors. The trouble starts
when I try to use it to write cgi scripts.

Here's the really basic test cgi script I tried

#!/usr/local/bin/perl

use CGI qw:)standard);
print header;
print "<h1> Hello World<h1>\n";


When I run it from a web browser I get the following in the apache
error log and a "Internal Sever Error" error on the browser.

Can't locate CGI.pm in @INC (@INC contains:
/usr/local/lib/perl5/5.8.0/aix /usr/local/lib/perl5/5.8.0
/usr/local/lib/perl5/site_perl/5.8.0/aix
/usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5/site_perl .)
at test.cgi line 3.
BEGIN failed--compilation aborted at test.cgi line 3.

Now if I run it from a unix shell as ./test.cgi I get this

ts> ./test.cgi
Content-Type: text/html; charset=ISO-8859-1

<h1> Hello</h1>
ts>


I don't understand why this is happening when it works from the
command line but not when it is used by the web server.

The error that is in the apache logs shows the correct @INC

If I do a "which perl" from the command line it's the right one

ts> which perl
/usr/local/bin/perl
ts>

Here's the out put from perl -V

ts> perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 0)
configuration:
Platform:
osname=aix, osvers=4.3.3.0, archname=aix
uname='aix tonysbox 3 4 004079284c00 '
config_args=''
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=unde
f
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc', ccflags ='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE
-DUSE_NAT
IVE_DLOPEN -fno-strict-aliasing -D_LARGE_FILES',
optimize='-O',
cppflags='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE
-DUSE_NATIVE_DLOPEN
-fno-strict-aliasing'
ccversion='', gccversion='3.2.3', gccosandvers='aix4.3.2.0'
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize
=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' -Wl,-brtl -L/usr/local/lib -Wl,-b32'
libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
libs=-lbind -lnsl -ldbm -ldl -lld -lm -lc -lcrypt -lbsd -lPW
perllibs=-lbind -lnsl -ldl -lld -lm -lc -lcrypt -lbsd -lPW
libc=/lib/libc.a, so=a, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_aix.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Xlinker
-bE:/usr/loc
al/lib/perl5/5.8.0/aix/CORE/perl.exp'
cccdlflags=' ', lddlflags=' -Wl,-bhalt:4 -Wl,-bM:SRE
-Wl,-bI:$(PERL_INC)/pe
rl.exp -Wl,-bE:$(BASEEXT).exp -Wl,-bnoentry -lc -L/usr/local/lib'


Characteristics of this binary (from libperl):
Compile-time options: USE_LARGE_FILES
Built under aix
Compiled at Aug 19 2003 17:49:03
@INC:
/usr/local/lib/perl5/5.8.0/aix
/usr/local/lib/perl5/5.8.0
/usr/local/lib/perl5/site_perl/5.8.0/aix
/usr/local/lib/perl5/site_perl/5.8.0
/usr/local/lib/perl5/site_perl/5.6.1
/usr/local/lib/perl5/site_perl
 
T

Tony Curtis

On 20 Aug 2003 05:53:25 -0700,
#!/usr/local/bin/perl
use CGI qw:)standard); print header; print "<h1> Hello
World<h1>\n";
When I run it from a web browser I get the following in
the apache error log and a "Internal Sever Error" error
on the browser.
Can't locate CGI.pm in @INC (@INC contains:
/usr/local/lib/perl5/5.8.0/aix
...
BEGIN failed--compilation aborted at test.cgi line 3.
Now if I run it from a unix shell as ./test.cgi I get
this

If it runs fine from the command line then the problem is
elsewhere.

Most likely it is in your web server configuration and/or
the restrictions of the uid as which CGI programs run
(e.g. nobody). There are plenty of these groups under
comp.infosystems.www.* including one for apache.


hth
t
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top