|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-08-23 14:37 UTC] wboring at qualys dot com
I have a site that I have written using the gdbm db on a redhat 6.2 box
for reasons out of my control, I cannot use a mysql/postgres/etc. style of db, and I am forced to use gdbm.
I am having intermittent problems with php 4.2.2 and dba_open.
on some pages I am getting php errors of
[23-Aug-2002 11:09:37] PHP Warning: driver initialization failed in ../lib/db.inc on line 72
[23-Aug-2002 11:09:37] PHP Warning: Unable to find DBA identifier 0 in ../lib/db.inc on line 131
[23-Aug-2002 11:09:37] PHP Warning: Unable to find DBA identifier 0 in ../lib/db.inc on line 274
[23-Aug-2002 11:09:37] PHP Warning: Unable to find DBA identifier 0 in ../lib/db.inc on line 275
[23-Aug-2002 11:09:37] PHP Warning: Unable to find DBA identifier 0 in ../lib/db.inc on line 276
db.inc is a class that I wrote to handle all access thru to a dba_* style db.
on access to a page works, the next fails w/ this driver initialization failed error.
I have gdbm 1.8.0-3 installed.
the dba_open call looks like
class db {
...
...
function connect() {
$this->_rsc = dba_open($this->get_db_filename(), "c", "gdbm");
if (!$this->_rsc) {
//we are in trouble here.
var_dump( "FAILED TO CONNECT TO DB ". $this->get_db_filename() );
var_dump( $this->_rsc );
}
}
I NEVER see the var_dump lines as php bails during the dba_open() call.
any ideas/help?
An ideas/help?
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 14:00:01 2025 UTC |
Ok So I modified the dba_gdbm.c's dba_open call to output a little debugging information if(dbf) { info->dbf = malloc(sizeof(dba_gdbm_data)); memset(info->dbf, 0, sizeof(dba_gdbm_data)); ((dba_gdbm_data *) info->dbf)->dbf = dbf; php_error(E_WARNING, "gdbm_open worked, %s\n", gdbm_strerror(gdbm_errno)); return SUCCESS; } else { php_error(E_WARNING, "gdbm_open failed %s\n", gdbm_strerror(gdbm_errno)); return FAILURE; } The error I am always getting is PHP Warning: gdbm_open failed Can't be writer from the gdbm_open call.