4 messages in com.mysql.lists.win32RE: WebDB.pm installation in Win32?
FromSent OnAttachments
Xu, Qiang (XSSC SGP)01 Aug 2003 00:22 
Xu, Qiang (XSSC SGP)06 Aug 2003 03:44 
Paul DuBois08 Aug 2003 21:45 
Paul DuBois08 Aug 2003 21:55 
Subject:RE: WebDB.pm installation in Win32?
From:Xu, Qiang (XSSC SGP) (Xu.Q@xssc.sgp.xerox.com)
Date:08/06/2003 03:44:04 AM
List:com.mysql.lists.win32

Hi, all:

I tried to solve this problem, but not successfully. I put the package WebDB.pm in the folder "D:\Apache Group\Apache\lib\perl".

And I re-configure my apache server, adding an alias in the file "http.conf": <IfModule mod_alias.c> ... Alias /apache-lib/ "D:/Apache Group/Apache/lib/"

<Directory "D:/Apache Group/Apache/lib"> Options None AllowOverride None Order allow,deny Allow from all </Directory> ... </IfModule>

And my perl script is as follows (I name it as "intro4.pl"):

#!d:/perl/bin/perl -w # select-user.pl - use current user's option file to connect use strict; use CGI qw(:standard); #use lib qw(/usr/local/apache/lib/perl); use lib qw(/apache-lib/perl/); use WebDB; my($dbh, $user); #$dbh = WebDB::connect(); $dbh = WebDB::connect_with_option_file(); $user = $dbh->selectrow_array ("SELECT USER()"); print header(), start_html("Select User"); print p("You connected as $user\n"); print end_html(); $dbh->disconnect(); exit(0);

But there is always Internal Server Error, the error log is:

[Wed Aug 06 18:41:11 2003] [error] [client 12.345.67.890] Premature end of script headers: d:/apache group/apache/cgi-bin/mysql/intro4.pl [Wed Aug 06 18:41:11 2003] [error] [client 12.345.67.890] Can't locate WebDB.pm in @INC (@INC contains: /apache-lib/perl/ d:/Perl/lib d:/Perl/site/lib .) at d:\APACHE~1\apache\cgi-bin\mysql\intro4.pl line 7.

[Wed Aug 06 18:41:11 2003] [error] [client 12.345.67.890] BEGIN failed--compilation aborted at d:\APACHE~1\apache\cgi-bin\mysql\intro4.pl line 7.

Why it still can't find the package WebDB.pm, although I have set the searching path for that package?

any suggestion is welcome,

thanks,

Hi, all:

In page 43 of <<MySQL and Perl for the Web>>, it says when we add the following lines in our scripts, we can use the functions in the package WebDB.pm: use lib qw(/usr/local/apache/lib/perl); use WebDB;

The first line adds the directory containing the module to the list of locations Perl searches when looking for module files, and the second line pulls in the code from the module.

To use like this, we must install the package into the folder "/usr/local/apache/lib/perl", yet this is for Linux/Unix, what folder should we put the package into when we use apache win32 distribution?

For example, my apache is installed in "D:\Apache Group\Apache\", and the root directory of my web server is "D:\Apache Group\Apache\htdocs". The folder "lib" is in the same level as the "htdocs" folder. So where should I put the package "WebDB.pm" into? And what should I write in my script to replace "use lib qw(/usr/local/apache/lib/perl);"?

Regards, Xu Qiang