Hi,

which versions of Perl/Apache/mod_perl/Embperl you are using? RPMs or
compiled from the source? Is mod_perl loaded as DSO or staticly linked into
Apache?

Maybe it help loading DBI and DBD::mysql at Server startup time (you should
do this with Embperl anyway) e.g. in your httpd.conf

PerlModule HTML::Embperl
PerlModule DBI
PerlModule DBD::mysql

Gerald


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     [EMAIL PROTECTED]         Voice:    +49 6133 925151
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------

----- Original Message -----
From: "Steve Wilder" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 28, 2000 5:29 AM
Subject: mod_perl/Embperl/MySQL problem


>
>   Hi all.
>
>   I've done this several times on other servers without any problems, but
> for some reason, I can't get any Perl-DBI script to talk to my MySQL
> database when Apache is involved.  Command line, it works fine, but
> mod_perl/Embperl stuff causes a segmentation fault.  It seems like as soon
> as I touch the DataSource for MySQL, it dies.
>
>   I've been dinking with this for a week on and off, with no luck.  I hope
> no one minds, but I'm going to paste some code, and error log stuff here:
>
> http://gmbp.m8rix.net/steve/test.phtml
> Looks like this:
> ---------------------------------------
> <html>
> <head>
> </head>
>
> <body>
>
> [-
> #use CGI qw(:netscape :standard);
> use DBI;
> #use DBD::mysql;
>
> #my $cgi = new CGI();
>
> DBI->trace(4, "dbitrace.log");
> -]
>
> <p>
>
> [+ scalar localtime() +]
> <p>
> <p>
> [+ join("\<br\>", DBI->available_drivers()) +]
> <p>
>
> <br>
> <pre>
> Data Sources for MySQL = [# DBI->data_sources('mysql') #]
>
> [-
> @mysql_ds = DBI->data_sources('mysql');
> -]
> [$ foreach $ds (@mysql_ds) $]
>         Data src = [+ scalar $ds +]<br>
> [$ endforeach $]
>
> [+
> $dbc_gmbp = DBI->connect("DBI:mysql:buypower", "www", "****",
>         {PrintError => 1,
>         RaiseError => 1});
> +]
> <br>
>
> [# $sth = $dbc_gmbp->prepare("select * from role_desc"); #]
> [# $dbc_gmbp->errstr #]
> [# $sth->execute(); #]
> [# $dbc_gmbp->errstr #]
>
> [# while (@aRow = $sth->fetchrow_array) #]
>         [+ join("\t", @aRow) +]
> [# endwhile #]
>
> </pre>
>
> [-
> #$sth->finish;
> $dbc_gmbp->disconnect;
> -]
>
>
> <br>
> ...End
> </html>
>
> ---------------------------------------
>
> If I uncomment the DBI->data_sources('mysql') part, it will come back with
> an empty document.  Which is what it does if I attempt to connect to the
> database.
>
> ---------------------------------------
>
>
> dbitrace.log looks like this:
> ---------------------------------------
>     DBI 1.14-nothread dispatch trace level set to 4
>     Note: perl is running without the recommended perl -w option
>     -> DBI->install_driver(mysql) for perl=5.00503 pid=11244 ruid=15
euid=15
>        install_driver: DBD::mysql loaded (version 2.0415)
>     New DBI::dr (for DBD::mysql::dr, parent=, id=)
>     dbih_setup_handle(DBI::dr=HASH(0x8dbc5ec)=>DBI::dr=HASH(0x8e52968),
> DBD::mys
> ql::dr, 0, Null!)
>     dbih_make_com(Null!, DBD::mysql::dr, 84)
>     <- install_driver= DBI::dr=HASH(0x8dbc5ec)
>     -> data_sources for DBD::mysql::dr (DBI::dr=HASH(0x8dbc5ec)~0x8e52968)
> 2   -> _ListDBs for DBD::mysql::dr (DBI::dr=HASH(0x8e52968)~INNER '')
> imp_dbh->MyConnect: host = NULL, port = 0, uid = NULL, pwd = NULL
> imp_dbh->MyConnect: client_flags = 0
> ---------------------------------------
>
> tail /usr/local/apache/logs/error_log is real helpful:
> [Tue Nov 21 17:41:55 2000] [notice] child pid 18449 exit signal
Segmentation
> fault (11)
>
> As is /tmp/embperl.log:
> [11244]MEM: Load /data/buypower/web/steve/test.phtml in
> HTML::Embperl::DOC::_1
>
>   Any help/advice/places to look for help/ would be appreciated.
>
> Thanks,
>
> Steve Wilder
> Matrix Interactive, Inc.
> http://www.matrixinteractive.net/
> Desk: 248.814.8235
> Cell: 248.894.3128
> Fax : 248.814.8236
>


----------------------------------------------------------------------------
----


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


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

Reply via email to