|
From: Joe Z. <jz...@co...> - 2004-04-28 06:36:28
|
SourceForge.net wrote: >hi there.....i am trying to use the new version of bobs, primarilly with nfs, >and i have this messages in the browse current link: > >Could not create a database of type db3 or db4 (tried both) >Warning: no such handler: in /var/www/html/bobs/inc/class_db.php on line 79 > >Warning: Unable to find DBA identifier 0 in /var/www/html/bobs/inc/class_db.php >on line 308 >No files were found in > >the backup process appears to be ok, i tried it with a few files, but in the >checking i have some messages about problems in write files, and i changed permission >and nothing happens... >can you help? thanks! > >Rodrigo >ro...@po... > > The problem is in /var/www/html/bobs/inc/class_db.php: 43 // check what dba type we should use 44 $tmpfile = tempnam("/tmp", "BOBS"); 45 $dbcheck = @dba_open($tmpfile, "c", "db3"); 46 if ( $dbcheck === FALSE ) { 47 $dbcheck = @dba_open($tmpfile, "c", "db4"); 48 if ( $dbcheck === FALSE ) { On my redhat 9 system, for some strange reason when this is run as user apache it fails to open the database. The temp file is created with 0 bytes. If I run it as myself or root it works fine. If I remove the '@' from @dba_open I see these errors when I "Browse Current": ------ Warning: driver initialization failed in /var/www/html/bobs/inc/class_db.php on line 45 Warning: no such handler: db4 in /var/www/html/bobs/inc/class_db.php on line 47 Could not create a database of type db3 or db4 (tried both) Warning: no such handler: in /var/www/html/bobs/inc/class_db.php on line 79 Warning: Unable to find DBA identifier 0 in /var/www/html/bobs/inc/class_db.php on line 308 No files were found in ------ Database creation during backups work because they are run by root from /etc/cron.daily/backup.php. I'll bet this only occurs on some systems/configurations. I even created a directory /var/www/tmp and made apache the owner/group and it still failed, do I don't think it's a permissions problem. Aha! I found the answer here: http://us4.php.net/manual/en/function.dba-open.php Note: Up to PHP 4.3.5 open mode 'c' is broken for several internal handlers and truncates the database instead of appending data to an existant database. Also dbm and ndbm fail on mode 'c' in typical configurations (this cannot be fixed). I have php-4.2.2-17.2 so mode "c" is broken. If I change the mode to "n" it work fine! I'll commit these changes later. Joe |