Hi,

from a mod_perl module using DBI and Apache::Registry as PerlModule i can
not connect to a mysql database. 

The Browser gets an error message that the document hat no data while in the
logfile of apache stands "child pid 31955 exit signal Segmentation fault
(11)". I am sure that the connection fails. (This script works no problem if
the connection to database is not needed.)

Strange is that there is no problem from a normal perl-cgi-script to connect
to this mysql-database. With eval-block i can not get any error message and
have no chance at all to handle the error.

I use the following versions :

Mysql : 3.22.32
Apache : 1.3.12 (Unix)
mod_perl : 1.24
DBI : 1.13
DBD::mysql 2.0414

Can someone help me? I am much appreciated for any suggestion.

My code looks like the followings:
----------------------------------------
use strict ;
use DBI ;

sub handler
{
# some codes
my $dbh;
eval{ $dbh=DBI->connect("DBI:mysql:my_database", "my_name", "my_passwd") or
die "Can't connect $DBI::errstr" ;} ;
        if ($@)
        {       # do something
                return OK ; 
        }
        else
        {       # do something; 
        }

# still codes
}

1;
-------------------------------------------

Regards,
Yen-Ying

Reply via email to