Re: Apache::DBI startup?

2002-03-20 Thread Doug Silver

On Wed, 20 Mar 2002, Stas Bekman wrote:

 Doug Silver wrote:
  I don't know if this is a PostgreSQL oddity, but in the startup.pl file, I
  can have the entry like so and it seems to start fine:
  
  Apache::DBI-connect_on_init
 (dbi:pg(PrintError=1,AutoCommit=0):, , )
 or die Cannot connect to database: $DBI::errstr;
  
  The error log shows a couple of 
  Apache::DBI PerlChildInitHandler entries, so I think it's working, but
  would like to confirm it.
 
 Yes
 
 see http://perl.apache.org/guide/databases.html#Debugging_Apache_DBI
 
 

Actually, that's what I had it on:

[Wed Mar 20 10:45:16 2002] [notice] Apache/1.3.22 (Unix) mod_perl/1.26
PHP/4.1.0 mod_ssl/2.8.5 OpenSSL/0.9.6a configured -- resuming normal
operations
30460 Apache::DBI PerlChildInitHandler 
30461 Apache::DBI PerlChildInitHandler 
30462 Apache::DBI PerlChildInitHandler 
30463 Apache::DBI PerlChildInitHandler 
30464 Apache::DBI PerlChildInitHandler 
[Wed Mar 20 10:45:16 2002] [notice] Accept mutex: flock (Default: flock)

From my startup.pl:
# choose debug output: 0 = off, 1 = quiet, 2 = chatty
$Apache::DBI::DEBUG = 2;

I guess I just wanted some confirmation on how the DBI was able to
establish the connection without a database or username specified.

Guess it's working, which is the main issue.
-- 
~
Doug Silver
Network Manager
Quantified Systems, Inc
~




Apache::DBI startup?

2002-03-19 Thread Doug Silver

I don't know if this is a PostgreSQL oddity, but in the startup.pl file, I
can have the entry like so and it seems to start fine:

Apache::DBI-connect_on_init
   (dbi:pg(PrintError=1,AutoCommit=0):, , )
   or die Cannot connect to database: $DBI::errstr;

The error log shows a couple of 
Apache::DBI PerlChildInitHandler entries, so I think it's working, but
would like to confirm it.

Thanks.

-- 
~
Doug Silver
Network Manager
Quantified Systems, Inc
~




Re: Apache::DBI startup?

2002-03-19 Thread Stas Bekman

Doug Silver wrote:
 I don't know if this is a PostgreSQL oddity, but in the startup.pl file, I
 can have the entry like so and it seems to start fine:
 
 Apache::DBI-connect_on_init
(dbi:pg(PrintError=1,AutoCommit=0):, , )
or die Cannot connect to database: $DBI::errstr;
 
 The error log shows a couple of 
 Apache::DBI PerlChildInitHandler entries, so I think it's working, but
 would like to confirm it.

Yes

see http://perl.apache.org/guide/databases.html#Debugging_Apache_DBI

-- 


_
Stas Bekman JAm_pH  --   Just Another mod_perl Hacker
http://stason.org/  mod_perl Guide   http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/




Apache::DBI startup failure

2002-03-14 Thread Doug Silver

I can't seem to get Apache::DBI to start up properly.

Here's my startup.pl:

#!/usr/bin/perl -w
use strict;
use Apache ();
use Apache::Status ();
use Apache::DBI (); #  This *must* come before all other DBI modules!
use Apache::Registry;
use CGI (); 
CGI-compile(':all');
use CGI::Carp ();
$Apache::DBI::DEBUG = 2;
Apache::DBI-connect_on_init
   (DBI:Pg:dbname=demo;host=localhost, demo, ,
  {
 PrintError = 1, # warn() on errors
 RaiseError = 0, # don't die on error
 AutoCommit = 0, # require transactions
  }
   )
   or die Cannot connect to database: $DBI::errstr;
1;

And here's what happens:
[Thu Mar 14 14:28:35 2002] [notice] Apache/1.3.22 (Unix) mod_perl/1.26 PHP/4.1.0 
mod_ssl/2.8.5 OpenSSL/0.9.6a configured -- resuming normal operations
13336 Apache::DBI PerlChildInitHandler 
13337 Apache::DBI PerlChildInitHandler 
13338 Apache::DBI PerlChildInitHandler 
13339 Apache::DBI PerlChildInitHandler 
13340 Apache::DBI PerlChildInitHandler 
[Thu Mar 14 14:28:35 2002] [notice] Accept mutex: flock (Default: flock)
[Thu Mar 14 14:28:35 2002] [notice] child pid 13338 exit signal Segmentation fault (11)
[Thu Mar 14 14:28:35 2002] [notice] child pid 13339 exit signal Segmentation fault (11)
[Thu Mar 14 14:28:35 2002] [notice] child pid 13337 exit signal Segmentation fault (11)
[Thu Mar 14 14:28:35 2002] [notice] child pid 13336 exit signal Segmentation fault (11)
[Thu Mar 14 14:28:36 2002] [notice] child pid 13340 exit signal Segmentation fault (11)

If I don't use the connect_on_init stuff, I can run a test script fine with those
exact db parameters.

Any suggestions?

Thanks!
-- 
~
Doug Silver
Network Manager
Quantified Systems, Inc
~




Re: Apache::DBI startup failure

2002-03-14 Thread Brendan W. McAdams

I've seen similar behavior with DBD::Sybase; if your SYBASE env variable
is not set or points at an invalid directory Apache starts up but begins
segging every child process over and over again.

I'm not familiar with Postgres but this might point you in the right
direction.

On Thu, 2002-03-14 at 18:09, Doug Silver wrote:
 I can't seem to get Apache::DBI to start up properly.
 
 Here's my startup.pl:
 
 #!/usr/bin/perl -w
 use strict;
 use Apache ();
 use Apache::Status ();
 use Apache::DBI ();   #  This *must* come before all other DBI modules!
 use Apache::Registry;
 use CGI (); 
 CGI-compile(':all');
 use CGI::Carp ();
 $Apache::DBI::DEBUG = 2;
 Apache::DBI-connect_on_init
(DBI:Pg:dbname=demo;host=localhost, demo, ,
   {
  PrintError = 1, # warn() on errors
  RaiseError = 0, # don't die on error
  AutoCommit = 0, # require transactions
   }
)
or die Cannot connect to database: $DBI::errstr;
 1;
 
 And here's what happens:
 [Thu Mar 14 14:28:35 2002] [notice] Apache/1.3.22 (Unix) mod_perl/1.26 PHP/4.1.0 
mod_ssl/2.8.5 OpenSSL/0.9.6a configured -- resuming normal operations
 13336 Apache::DBI PerlChildInitHandler 
 13337 Apache::DBI PerlChildInitHandler 
 13338 Apache::DBI PerlChildInitHandler 
 13339 Apache::DBI PerlChildInitHandler 
 13340 Apache::DBI PerlChildInitHandler 
 [Thu Mar 14 14:28:35 2002] [notice] Accept mutex: flock (Default: flock)
 [Thu Mar 14 14:28:35 2002] [notice] child pid 13338 exit signal Segmentation fault 
(11)
 [Thu Mar 14 14:28:35 2002] [notice] child pid 13339 exit signal Segmentation fault 
(11)
 [Thu Mar 14 14:28:35 2002] [notice] child pid 13337 exit signal Segmentation fault 
(11)
 [Thu Mar 14 14:28:35 2002] [notice] child pid 13336 exit signal Segmentation fault 
(11)
 [Thu Mar 14 14:28:36 2002] [notice] child pid 13340 exit signal Segmentation fault 
(11)
 
 If I don't use the connect_on_init stuff, I can run a test script fine with those
 exact db parameters.
 
 Any suggestions?
 
 Thanks!
 -- 
 ~
 Doug Silver
 Network Manager
 Quantified Systems, Inc
 ~
 
-- 
Brendan W. McAdams | [EMAIL PROTECTED]
Senior Applications Developer  | (646) 375-1140
TheMuniCenter, LLC | www.themunicenter.com

Always listen to experts. They'll tell you what can't be done, and why.
Then do it.
- Robert A. Heinlein



signature.asc
Description: This is a digitally signed message part


Re: Apache::DBI startup failure

2002-03-14 Thread Doug Silver

Ok, I found it, but this has got to be some kind of bug.

This works:
Apache::DBI-connect_on_init(dbi:pg:demo,demo);

This doesn't:
Apache::DBI-connect_on_init(dbi:Pg:demo,demo);

That's right, putting 'dbi:pg' in lowercase made it work. I looked through
some old newsgroup stuff and saw someone using Postgres had it similar to
that.  

Here's some further debugging information for the developers:
perl -v = v5.6.1 on i386-freebsd (FreeBSD 4.4)
# pkg_info |egrep -i dbi|postgres
p5-Apache-DBI-0.88  DBI persistent connection, authentication and authorization
p5-DBD-Pg-1.01  Provides access to PostgreSQL databases through the DBI
p5-DBI-1.20 The perl5 Database Interface.  Required for DBD::* modules
postgresql-7.1.3A robust, next generation, object-relational DBMS

-doug

On 14 Mar 2002, Brendan W. McAdams wrote:

 I've seen similar behavior with DBD::Sybase; if your SYBASE env variable
 is not set or points at an invalid directory Apache starts up but begins
 segging every child process over and over again.
 
 I'm not familiar with Postgres but this might point you in the right
 direction.
 
 On Thu, 2002-03-14 at 18:09, Doug Silver wrote:
  I can't seem to get Apache::DBI to start up properly.
  
  Here's my startup.pl:
  
  #!/usr/bin/perl -w
  use strict;
  use Apache ();
  use Apache::Status ();
  use Apache::DBI (); #  This *must* come before all other DBI modules!
  use Apache::Registry;
  use CGI (); 
  CGI-compile(':all');
  use CGI::Carp ();
  $Apache::DBI::DEBUG = 2;
  Apache::DBI-connect_on_init
 (DBI:Pg:dbname=demo;host=localhost, demo, ,
{
   PrintError = 1, # warn() on errors
   RaiseError = 0, # don't die on error
   AutoCommit = 0, # require transactions
}
 )
 or die Cannot connect to database: $DBI::errstr;
  1;
  




[Fwd: Re: Apache::DBI startup failure]

2002-03-14 Thread Brendan W. McAdams

Weird, although I bet if you had straced the apache processes you would
have seen the File not found.

For some reason I recall DBD Drivers being case sensitive.
On Thu, 2002-03-14 at 20:06, Doug Silver wrote:
 Ok, I found it, but this has got to be some kind of bug.
 
 This works:
 Apache::DBI-connect_on_init(dbi:pg:demo,demo);
 
 This doesn't:
 Apache::DBI-connect_on_init(dbi:Pg:demo,demo);
 
 That's right, putting 'dbi:pg' in lowercase made it work. I looked through
 some old newsgroup stuff and saw someone using Postgres had it similar to
 that.  
 
 Here's some further debugging information for the developers:
 perl -v = v5.6.1 on i386-freebsd (FreeBSD 4.4)
 # pkg_info |egrep -i dbi|postgres
 p5-Apache-DBI-0.88  DBI persistent connection, authentication and authorization
 p5-DBD-Pg-1.01  Provides access to PostgreSQL databases through the DBI
 p5-DBI-1.20 The perl5 Database Interface.  Required for DBD::* modules
 postgresql-7.1.3A robust, next generation, object-relational DBMS
 
 -doug
 
 On 14 Mar 2002, Brendan W. McAdams wrote:
 
  I've seen similar behavior with DBD::Sybase; if your SYBASE env variable
  is not set or points at an invalid directory Apache starts up but begins
  segging every child process over and over again.
  
  I'm not familiar with Postgres but this might point you in the right
  direction.
  
  On Thu, 2002-03-14 at 18:09, Doug Silver wrote:
   I can't seem to get Apache::DBI to start up properly.
   
   Here's my startup.pl:
   
   #!/usr/bin/perl -w
   use strict;
   use Apache ();
   use Apache::Status ();
   use Apache::DBI ();   #  This *must* come before all other DBI 
modules!
   use Apache::Registry;
   use CGI (); 
   CGI-compile(':all');
   use CGI::Carp ();
   $Apache::DBI::DEBUG = 2;
   Apache::DBI-connect_on_init
  (DBI:Pg:dbname=demo;host=localhost, demo, ,
 {
PrintError = 1, # warn() on errors
RaiseError = 0, # don't die on error
AutoCommit = 0, # require transactions
 }
  )
  or die Cannot connect to database: $DBI::errstr;
   1;
   
 
-- 
Brendan W. McAdams | [EMAIL PROTECTED]
Senior Applications Developer  | (646) 375-1140
TheMuniCenter, LLC | www.themunicenter.com

Always listen to experts. They'll tell you what can't be done, and why.
Then do it.
- Robert A. Heinlein
-- 
Brendan W. McAdams | [EMAIL PROTECTED]
Senior Applications Developer  | (646) 375-1140
TheMuniCenter, LLC | www.themunicenter.com

Always listen to experts. They'll tell you what can't be done, and why.
Then do it.
- Robert A. Heinlein



signature.asc
Description: This is a digitally signed message part