On Sun, 19 Jan 2003, Daryl Lee wrote:

> The following is the full report of a problem I'm having.  Any pointers
> will be appreciated.  I'm worried I may have the wrong "mod_perl2"--it's
> not clear to me why the version number should be "1.99_08"; I expected
> "2.x".

That version number is correct - mod_perl 1.99_xx is the
development version for mod_perl 2.0.

> -------------8<---------- Start Bug Report ------------8<----------
> 1. Problem Description:
> 
>    DBI doesn't connect to MySQL when running under mod_perl2's perl-script.
> 
>    The following script works correctly when run from the command line, as
>       #cgi-bin/dbi.pl,
>       or as a standard CGI script, i.e.,
>       http://localhost/cgi-bin/dbi.pl.  
>       But when run as precompiled under mod_perl2, i.e, as 
>       http://localhost/cgi/dbi.pl,
>       the connection fails with DBI=>errstr() reporting
>       "Can't connect to local MySQL server through socket
> '/tmp/mysql.sock' (2)".
>       The last line of error_log is:
> DBI connect('people','apache',...) failed: Can't connect to local MySQL
> server through socket '/tmp/mysql.sock' (2) at
> /usr/local/apache2/perl/dbi.pl line 5
>       I also installed Apache::DBI and "use"'d it, with the same result.
> 
> Script:
> 
> #!/usr/bin/perl
> use strict;
> use DBI;
> # connect to the MySQL server
> my $dbh = DBI->connect('DBI:mysql:people', 'apache', 'LampIsCool');
> print "Content-type: text/plain\n\n";
> if ($dbh) {
>       print "Connected\n";
>       $dbh->disconnect();
> } else {
>       print "Connection failed\n";
>       print DBI->errstr();
> }
> 
> The configuration section from httpd.conf is:
> Alias /cgi /usr/local/apache2/perl
> <Location /cgi>
>   SetHandler                    perl-script
>   PerlResponseHandler   ModPerl::Registry
>   PerlOptions                   +ParseHeaders
> </Location>
> 
> 2. Used Components and their Configuration: Besides the
> following output from t/REPORT, I have just installed DBI v1.32
> from CPAN.  mod_perl2 (1.99_08) was just installed a few days
> ago.
[ ... ] 
> Characteristics of this binary (from libperl): 
>   Compile-time options: MULTIPLICITY USE_ITHREADS
> USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
>   Built under linux
>   Compiled at Sep  1 2002 23:56:49
>   %ENV:
>     PERL_LWP_USE_HTTP_10="1"
>   @INC:
>     /usr/lib/perl5/5.8.0/i386-linux-thread-multi
>     /usr/lib/perl5/5.8.0
>     /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
>     /usr/lib/perl5/site_perl/5.8.0
>     /usr/lib/perl5/site_perl
>     /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
>     /usr/lib/perl5/vendor_perl/5.8.0
>     /usr/lib/perl5/vendor_perl
>     .

Are DBI and DBD::mysql under site_perl/? If so, might there also
be versions of these (or perhaps other) modules under
vendor_perl/ that mod_perl is picking up, and perhaps getting
confused with?

-- 
best regards,
randy kobes


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to