perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ray Chuan" <rctay1...@hotmail.com>
Subject Re: [error] Can't locate object method "bootstrap" via package "DBI"
Date Fri, 03 Dec 2004 01:31:30 GMT
Thanks for all the help. Apparently, I changed the Apache's service logon 
settings, and it now works.

>From: "Ray Chuan" <rctay1989@hotmail.com>
>To: randy@theoryx5.uwinnipeg.ca
>CC: modperl@perl.apache.org
>Subject: Re: [error] Can't locate object method "bootstrap" via package 
>"DBI"
>Date: Fri, 03 Dec 2004 09:28:43 +0800
>
>yes, it worked...great, first time smth with DBI worked.
>
>Apache, MySQL and Perl all sit in the same dir, and drive.
>
>>From: Randy Kobes <randy@theoryx5.uwinnipeg.ca>
>>To: Ray Chuan <rctay1989@hotmail.com>
>>CC: modperl@perl.apache.org
>>Subject: Re: [error] Can't locate object method "bootstrap" via package 
>>"DBI"
>>Date: Thu, 2 Dec 2004 09:21:05 -0600 (CST)
>>
>>On Thu, 2 Dec 2004, Ray Chuan wrote:
>>
>> > >- can you use, for example, DBI, in a simple mod_perl
>> > >handler?
>> >
>> > no, even a bare script which invokes connect than
>> > disconnect fails, as with the first post:
>> > ===
>> > #!F:/Net/Perl/bin/Perl.exe
>> > ##
>> > ## Perl eg
>> > use strict;
>> > use DBI;
>> >
>> > my $dbh = DBI->connect("DBI:mysql:webdb;localhost", "foo", "p",
>> > {PrintError=>0,RaiseError=>1});
>> > $dbh->disconnect();
>> > ===
>>
>>Sorry I wasn't clear - I meant to try this in a handler
>>other then ModPerl::Registry, something like:
>>=====================================================
>># file Apache/Hello.pm
>>package Apache::Hello;
>>use strict;
>>use Apache::RequestRec ();  # for $r->content_type
>>use Apache::RequestIO ();   # for $r->print
>>use Apache::Const -compile => ':common';
>>use DBI;
>>
>>sub handler {
>>    my $r = shift;
>>    my $dbh = DBI->connect("DBI:mysql:webdb;localhost",
>>        "foo", "p", {PrintError=>0,RaiseError=>1});
>>    $dbh->disconnect();
>>    my $time = scalar localtime();
>>    my $package = __PACKAGE__;
>>    $r->content_type('text/html');
>>    $r->print(<<"END");
>><HTML><BODY>
>><H3>Hello</H3>
>>Hello from <B>$package</B>! The time is $time.
>></BODY></HTML>
>>END
>>    return Apache::OK;
>>}
>>
>>1;
>>===========================================================
>>saved in F:\Net\Perl\site\lib\Apache2\Apache\Hello.pm,
>>and then invoked in your httpd.conf as
>>===========================================================
>>PerlModule Apache::Hello
>><Location /hello>
>>    SetHandler perl-script
>>    PerlResponseHandler Apache::Hello
>></Location>
>>==========================================================
>>and accessed as http://localhost/hello.
>>
>>One other thing - is your Apache installation also on
>>the F drive? If not, and if possible, can you try an
>>Apache on F to see if that works (or try moving Perl
>>to the drive Apache is on)?
>>
>>--
>>best regards,
>>randy
>>
>>--
>>Report problems: http://perl.apache.org/bugs/
>>Mail list info: http://perl.apache.org/maillist/modperl.html
>>List etiquette: http://perl.apache.org/maillist/email-etiquette.html
>>
>
>_________________________________________________________________
>Find it on the web with MSN Search. http://search.msn.com.sg/
>
>
>--
>Report problems: http://perl.apache.org/bugs/
>Mail list info: http://perl.apache.org/maillist/modperl.html
>List etiquette: http://perl.apache.org/maillist/email-etiquette.html
>

_________________________________________________________________
Find love on MSN Personals http://personals.msn.com.sg/


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Mime
View raw message