From: Adam S. <la...@sp...> - 2001-03-05 10:19:19
|
hey. hopefully i'm just being stupid and it's an obvious problem because i really want this to work. i'm a relative newbie with php but haven't had many problems with other programs i want to work. i'm using debian linux, php4.0.4pl1 and apache 1.3.14. phpwiki works great when i set it like this in lib/conifig.php: $WhichDatabase = 'file'; but as soon as i try to set it to 'dba' i get this error: Warning: Variable passed to reset() is not an array or object in /var/www/devel.spack.org/phpwiki/lib/dbalib.php on line 52 Warning: Variable passed to each() is not an array or object in /var/www/devel.spack.org/phpwiki/lib/dbalib.php on line 53 WikiFatalError Cannot open database 'wiki' : '/tmp/wikipagesdb', giving up. the web server does have permissions to write there because it works just fine in file mode so i'm not sure what to do. i'm wondering if debian has done something a little weird, it breaks all the php extensions into seperate packages so i only have the core, imap and gd ones installed. does dba need to be listed in an "extension=xxx" line in my php.ini file? regardless any help would be much appreciated. thanks, adam. |
From: Steve W. <sw...@pa...> - 2001-03-05 18:40:40
|
On Mon, 5 Mar 2001, Adam Shand wrote: > phpwiki works great when i set it like this in lib/conifig.php: > > $WhichDatabase = 'file'; > > but as soon as i try to set it to 'dba' i get this error: > > Warning: Variable passed to reset() is not an array or object in /var/www/devel.spack.org/phpwiki/lib/dbalib.php on line 52 > Warning: Variable passed to each() is not an array or object in /var/www/devel.spack.org/phpwiki/lib/dbalib.php on line 53 > WikiFatalError > Cannot open database 'wiki' : '/tmp/wikipagesdb', giving up. First, I hope you don't name the file directory and the DBM files the same... that's just an initial guess. > > the web server does have permissions to write there because it works just > fine in file mode so i'm not sure what to do. i'm wondering if debian has > done something a little weird, it breaks all the php extensions into > seperate packages so i only have the core, imap and gd ones installed. > does dba need to be listed in an "extension=xxx" line in my php.ini file? There was a post on the list recently about a special config option, and I think it was about Debian but I can't find it in the list archives... a module had to be loaded by PHP at runtime. Also, did you compile the package yourself or use get-apt (or whatever Debian uses?) You might try setting it to 'dbm' instead of 'dba' and see if that works. I was wondering if dba_* support was compiled in or not. Let me know if any of that helps and we'll try again if not. ~swain --- http://wcsb.org/~swain/ "Without music to decorate it, time is just a bunch of boring production deadlines or dates by which bills must be paid." -- Frank Zappa |
From: Adam S. <la...@sp...> - 2001-03-06 07:41:09
|
> First, I hope you don't name the file directory and the DBM files the > same... that's just an initial guess. i was under the impression that phpwiki would create the dbm files itself. it creates the flat files itself? if that's not what you mean then i don't understand sorry ... here's the relevant section of my config file: $WhichDatabase = 'dba'; // use one of "dbm", "dba", "mysql", // "pgsql", "msql", or "file" // DBM and DBA settings (default) if ($WhichDatabase == 'dbm' or $WhichDatabase == 'dba' or $WhichDatabase == 'default') { $DBMdir = "/tmp"; $WikiPageStore = "wiki"; $ArchivePageStore = "archive"; $WikiDB['wiki'] = "$DBMdir/wikipagesdb"; $WikiDB['archive'] = "$DBMdir/wikiarchivedb"; $WikiDB['wikilinks'] = "$DBMdir/wikilinksdb"; $WikiDB['hottopics'] = "$DBMdir/wikihottopicsdb"; $WikiDB['hitcount'] = "$DBMdir/wikihitcountdb"; > There was a post on the list recently about a special config option, > and I think it was about Debian but I can't find it in the list > archives... a module had to be loaded by PHP at runtime. was there a solution? i know debian pretty well but i can't find any documentation exactly where the dba module is. the docs say it's compiled in and it looks like it is from running strings on the php binary but it's more then possible that i have to enable something in a config file or something. > Also, did you compile the package yourself or use get-apt (or whatever > Debian uses?) You might try setting it to 'dbm' instead of 'dba' and > see if that works. I was wondering if dba_* support was compiled in or > not. i used apt-get. when i try dbm i get a blank page in my browser with just this when i view source: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- $Id: index.php,v 1.5 2000/11/08 15:34:06 ahollosi Exp $ --> <!-- $Id: config.php,v 1.24 2001/01/31 07:38:10 ahollosi Exp $ --> <!-- $Id: dbmlib.php,v 1.7 2001/01/31 03:11:25 wainstead Exp $ --> <!-- $Id: stdlib.php,v 1.21 2001/01/15 12:32:57 ahollosi Exp $ --> adam. |
From: Steve W. <sw...@pa...> - 2001-03-06 15:39:41
|
On Mon, 5 Mar 2001, Adam Shand wrote: > i used apt-get. when i try dbm i get a blank page in my browser with just > this when i view source: > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> > <!-- $Id: index.php,v 1.5 2000/11/08 15:34:06 ahollosi Exp $ --> > <!-- $Id: config.php,v 1.24 2001/01/31 07:38:10 ahollosi Exp $ --> > <!-- $Id: dbmlib.php,v 1.7 2001/01/31 03:11:25 wainstead Exp $ --> > <!-- $Id: stdlib.php,v 1.21 2001/01/15 12:32:57 ahollosi Exp $ --> Aha. Well, this is some problem with either the dba_ support or the dbm support; you see, the dbm* functions are deprecated in PHP4.0 in favor of the dba_* functions, which are a more generic interface. This has caused us a lot of install problems. Did you try setting your database type to "dbm" and see if that works? If not, the next step is to set it to "dba" again, and edit dbalib.php and remove the '@' symbol from the dba_open() call: function OpenDataBase($dbname) { global $WikiDB; // hash of all the DBM file names reset($WikiDB); while (list($key, $file) = each($WikiDB)) { while (($dbi[$key] = @dba_open($file, "c", "gdbm")) < 1) { ------------------------------^ right here $numattempts++; if ($numattempts > MAX_DBM_ATTEMPTS) { ExitWiki("Cannot open database '$key' : '$file', giving up."); } sleep(1); } } return $dbi; } With the '@' removed you will get a verbose error message telling us what the problem is. ~swain --- http://wcsb.org/~swain/ "Without music to decorate it, time is just a bunch of boring production deadlines or dates by which bills must be paid." -- Frank Zappa |
From: Adam S. <la...@sp...> - 2001-03-06 18:59:13
|
> Did you try setting your database type to "dbm" and see if that works? > If not, the next step is to set it to "dba" again, and edit dbalib.php > and remove the '@' symbol from the dba_open() call: err, this was with it set to dbm. with it set to dba i get the original error i reported: Warning: Variable passed to reset() is not an array or object in /var/www/devel.spack.org/phpwiki/lib/dbalib.php on line 52 Warning: Variable passed to each() is not an array or object in /var/www/devel.spack.org/phpwiki/lib/dbalib.php on line 53 WikiFatalError Cannot open database 'wiki' : '/tmp/wikipagesdb', giving up. > With the '@' removed you will get a verbose error message telling us > what the problem is. now i get this: Warning: no such handler: gdbm in /var/www/devel.spack.org/phpwiki/lib/dbalib.php on line 39 Warning: no such handler: gdbm in /var/www/devel.spack.org/phpwiki/lib/dbalib.php on line 39 Warning: no such handler: gdbm in /var/www/devel.spack.org/phpwiki/lib/dbalib.php on line 39 Warning: Variable passed to reset() is not an array or object in /var/www/devel.spack.org/phpwiki/lib/dbalib.php on line 52 Warning: Variable passed to each() is not an array or object in /var/www/devel.spack.org/phpwiki/lib/dbalib.php on line 53 WikiFatalError Cannot open database 'wiki' : '/tmp/wikipagesdb', giving up. adam. |
From: <sw...@pa...> - 2001-03-06 23:32:13
|
Adam Shand wrote: > Warning: Variable passed to reset() is not an array or object in /var/www/devel.spack.org/phpwiki/lib/dbalib.php on line 52 > Warning: Variable passed to each() is not an array or object in /var/www/devel.spack.org/phpwiki/lib/dbalib.php on line 53 > WikiFatalError > Cannot open database 'wiki' : '/tmp/wikipagesdb', giving up. Yes, this is just PHP saying it got a variable that should be an array but was not. > > With the '@' removed you will get a verbose error message telling us > > what the problem is. > > now i get this: > > Warning: no such handler: gdbm in /var/www/devel.spack.org/phpwiki/lib/dbalib.php on line 39 > Warning: no such handler: gdbm in /var/www/devel.spack.org/phpwiki/lib/dbalib.php on line 39 > Warning: no such handler: gdbm in /var/www/devel.spack.org/phpwiki/lib/dbalib.php on line 39 I can't find any reference to this error on the PHP site... perhaps you could email the maintainer of the PHP package for Debian? I wish I could offer more but at the moment I'm stumped. ~swain > Warning: Variable passed to reset() is not an array or object in /var/www/devel.spack.org/phpwiki/lib/dbalib.php on line 52 > Warning: Variable passed to each() is not an array or object in /var/www/devel.spack.org/phpwiki/lib/dbalib.php on line 53 > WikiFatalError > Cannot open database 'wiki' : '/tmp/wikipagesdb', giving up. |