Mailing List Archive

APACHE::ASP Error
Hi,

I'm getting the following error when I run my Perl application

---------------------------------------------
cannot load DB_File for StateDB: cannot load StateDB must be a valid
perl module with a db tied hash interface such as: SDBM_File
(default), or DB_File; Can't locate DB_File.pm in @INC (@INC
contains: ./lib /usr/local/lib/perl5/site_perl/5.8.6/sun4-
solaris /usr/local/lib/perl5/site_perl/5.8.6 . /usr/local/lib/perl5/si
te_perl/5.8.6//sun4-
solaris /usr/local/lib/perl5/site_perl/5.8.6/ /usr/local/lib/perl5/5.8
.6/sun4-
solaris /usr/local/lib/perl5/5.8.6 /usr/local/lib/perl5/site_perl /usr
/local/apache/ /usr/local/apache/lib/perl) at (eval 56) line 2. at
(eval 56) line 2 Apache::ASP::BEGIN() called at DB_File.pm line 2
eval {...} called at DB_File.pm line 2 eval 'use DB_File ;' called
at /usr/local/lib/perl5/site_perl/5.8.6/Apache/ASP.pm line 1953
Apache::ASP::LoadModules('Apache::ASP=HASH
(0x442760)', 'StateDB', 'DB_File') called
at /usr/local/lib/perl5/site_perl/5.8.6/Apache/ASP/StateManager.pm
line 50 Apache::ASP::InitState('Apache::ASP=HASH(0x442760)') called
at /usr/local/lib/perl5/site_perl/5.8.6/Apache/ASP.pm line 418
Apache::ASP::new('Apache::ASP', 'Apache=SCALAR
(0x2cb6dc)', '/usr/local/apache/htdocs/display.asp') called
at /usr/local/lib/perl5/site_perl/5.8.6/Apache/ASP.pm line 181
Apache::ASP::handler('Apache=SCALAR(0x2cb6dc)') called at DB_File.pm
line 2 eval {...} called at DB_File.pm line 2 BEGIN failed--
compilation aborted at (eval 56) line 2. at (eval 56) line 2
eval 'use DB_File ;' called
at /usr/local/lib/perl5/site_perl/5.8.6/Apache/ASP.pm line 1953
Apache::ASP::LoadModules('Apache::ASP=HASH
(0x442760)', 'StateDB', 'DB_File') called
at /usr/local/lib/perl5/site_perl/5.8.6/Apache/ASP/StateManager.pm
line 50 Apache::ASP::InitState('Apache::ASP=HASH(0x442760)') called
at /usr/local/lib/perl5/site_perl/5.8.6/Apache/ASP.pm line 418
Apache::ASP::new('Apache::ASP', 'Apache=SCALAR
(0x2cb6dc)', '/usr/local/apache/htdocs/display.asp') called
at /usr/local/lib/perl5/site_perl/5.8.6/Apache/ASP.pm line 181
Apache::ASP::handler('Apache=SCALAR(0x2cb6dc)') called at (eval 56)
line 2 eval {...} called at (eval 56) line
2 , /usr/local/lib/perl5/site_perl/5.8.6/Apache/ASP.pm line 1955
---------------------------------------------

What I understood from this error is that the DB_File module is not
installed. So I tried installing the DB_File module. But then I get
the following error :(

---------------------------------------------
Note (probably harmless): No library found for -ldb
Writing Makefile for DB_File
cp DB_File.pm blib/lib/DB_File.pm
AutoSplitting blib/lib/DB_File.pm (blib/lib/auto/DB_File)
gcc -c -I/usr/local/BerkeleyDB/include -fno-strict-aliasing -pipe -
I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -
DVERSION=\"1.811\" -DXS_VERSION=\"1.811\" -fPIC "-
I/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE" -D_NOT_CORE -
DmDB_Prefix_t=size_t -DmDB_Hash_t=u_int32_t version.c
version.c:30:16: db.h: No such file or directory
*** Error code 1
make: Fatal error: Command failed for target `version.o'
/usr/ccs/bin/make -- NOT OK
Running make test
Can't test without successful make
Running make install
make had returned bad status, install seems impossible
---------------------------------------------

I couldn't find a proper solution for this problem. I saw some
suggestions of installing BerkeleyDB. But isn't that overkill. Do
we really need to install the DB_File and BerkleyDB modules to work
with Apache::ASP?

I also thought of using MLDBM::Sync::SDBM_File instead of DB_File.
But it's mentioned that

The output caching layer is a file dbm based output cache that runs
on top of the MLDBM::Sync so inherits its performance
characteristics.
With CacheDB set to MLDBM::Sync::SDBM_File, the cache layer is
very fast at caching entries up to 20K in size, but for greater
cached items, you should set CacheDB to another dbm like DB_File
or GDBM_File.

So will it be a good idea to use MLDBM::Sync::SDBM_File? Could you
please let me know how to resolve this Apache::ASP error.

Following is the settings in my httpd.conf file.

<Files ~ (\.asp)>
AllowOverride All
Allow from all
SetHandler perl-script
PerlModule Apache::DBI
PerlHandler Apache::ASP
PerlSetVar SessionTimeout 120
PerlSetVar StateManager 60
PerlSetVar StateDB DB_File
PerlSetVar Global /usr/local/apache/htdocs
PerlSetVar StateDir /tmp/WebData
PerlSetVar Debug 2
</Files>

Perl -V output

Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
Platform:
osname=solaris, osvers=2.8, archname=sun4-solaris
uname='sunos parker 5.8 generic_117350-07 sun4u sparc sunw,ultra-
4 '
config_args='-de'
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='gcc', ccflags ='-fno-strict-aliasing -pipe -
I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O',
cppflags='-fno-strict-aliasing -pipe -I/usr/local/include'
ccversion='', gccversion='3.3.2', gccosandvers='solaris2.8'
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
d_longlong=define, longlongsize=8, d_longdbl=define,
longdblsize=16
ivtype='long', ivsize=4, nvtype='double', nvsize=8,
Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib '
libpth=/usr/local/lib /usr/lib /usr/ccs/lib
libs=-lsocket -lnsl -ldl -lm -lc
perllibs=-lsocket -lnsl -ldl -lm -lc
libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'


Characteristics of this binary (from libperl):
Compile-time options: USE_LARGE_FILES
Built under solaris
Compiled at Mar 21 2005 23:54:20
@INC:
/usr/local/lib/perl5/5.8.6/sun4-solaris
/usr/local/lib/perl5/5.8.6
/usr/local/lib/perl5/site_perl/5.8.6/sun4-solaris
/usr/local/lib/perl5/site_perl/5.8.6
/usr/local/lib/perl5/site_perl
.

Thanks,
Sangeeth




---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org
Re: APACHE::ASP Error [ In reply to ]
sangeethvs wrote:
>
> suggestions of installing BerkeleyDB. But isn't that overkill. Do
> we really need to install the DB_File and BerkleyDB modules to work
> with Apache::ASP?

There are alternate state storage models, but BDB is certainly a good
choice. I seem to recall that one of the options is a native Perl
module (i.e. no C code, as in BDB) but that would be slower.

Bottom line, you definitely need some database layer to store the ASP
state data.

What's wrong with installing BDB? It's been around since before Linux
became the biggest *ix, so it probably builds out of the box on your
Solaris system.

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org