From: Alan H. <al...@em...> - 2005-04-18 17:50:17
|
Hi all, I've done a few searches for answers online, but the archives for PHPWiki list at sourceforge appear to be down (along with the entire search capability at sf.net).... Anyway, I was happily running PHPWiki 1.3.x on RedHat 9.0 for a long time and finally got fed up with the lack of updates. So, I upgraded to Fedora Core 3. I discovered that the default installation of PHP didn't include GDBM support, so I installed the php-4.3.11-2.4.src.rpm, edited the spec file to add the --with-gdbm and --enable-dba options, recompiled, and reinstalled PHP. restarted Apache, and I'm now getting the following error message: lib/DbaDatabase.php:54: Error[256]: dba_open(/home/alanh/html/wiki/pages/pagedb.gdbm,c): Driver initialization failed for handler: gdbm: File open error file: /home/alanh/html/wiki/pages/pagedb.gdbm mode: c handler: gdbm I don't think this is a permissions problem: $ ls -l /home/alanh/html/wiki/pages/pagedb.gdbm -rwxrwxrwx 1 apache apache 1024021 Apr 13 08:46 /home/alanh/html/wiki/pages/pagedb.gdbm* Any suggestions as to what to try? Again, I apologize if this has been answered in the past. -alan -- Alan Hoyle - al...@un... - http://www.alanhoyle.com/ "I don't want the world, I just want your half." -TMBG Get Horizontal, Play Ultimate. |
From: Reini U. <ru...@x-...> - 2005-04-18 18:01:19
|
Alan Hoyle schrieb: > Hi all, > > I've done a few searches for answers online, but the archives for > PHPWiki list at sourceforge appear to be down (along with the entire > search capability at sf.net).... > > Anyway, I was happily running PHPWiki 1.3.x on RedHat 9.0 for a long > time and finally got fed up with the lack of updates. So, I upgraded to > Fedora Core 3. I discovered that the default installation of PHP didn't > include GDBM support, so I installed the php-4.3.11-2.4.src.rpm, edited > the spec file to add the --with-gdbm and --enable-dba options, > recompiled, and reinstalled PHP. restarted Apache, and I'm now getting > the following error message: > > lib/DbaDatabase.php:54: Error[256]: > dba_open(/home/alanh/html/wiki/pages/pagedb.gdbm,c): Driver > initialization failed for handler: gdbm: File open error > file: /home/alanh/html/wiki/pages/pagedb.gdbm > mode: c > handler: gdbm > > I don't think this is a permissions problem: > > $ ls -l /home/alanh/html/wiki/pages/pagedb.gdbm > -rwxrwxrwx 1 apache apache 1024021 Apr 13 08:46 > /home/alanh/html/wiki/pages/pagedb.gdbm* > > Any suggestions as to what to try? Yes, see the current sozurce of lib/DbaDatabase.php what I had to do to workaround gdbm bugs. if "c" fails try "w" with the second try. Only Windows needs "-" -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ http://phpwiki.org/ |
From: Alan H. <al...@em...> - 2005-04-18 19:07:26
|
On Mon, 18 Apr 2005 at 20:02, Reini Urban wrote: >> lib/DbaDatabase.php:54: Error[256]: >> dba_open(/home/alanh/html/wiki/pages/pagedb.gdbm,c): Driver initialization >> failed for handler: gdbm: File open error >> file: /home/alanh/html/wiki/pages/pagedb.gdbm >> mode: c >> handler: gdbm >> >> Any suggestions as to what to try? > > Yes, > see the current sozurce of lib/DbaDatabase.php what I had to do to workaround > gdbm bugs. > if "c" fails try "w" with the second try. > Only Windows needs "-" Hi Reini, I'm looking at the version of DbaDatabase.php that was included in phpwiki-1.3.11_rc1 and I don't understand quite what you mean. I see the following code fragment on lines 46-53: 46 if (check_php_version(4,3,0) and (strlen($mode) == 1)) { 47 // PHP 4.3.x Windows lock bug workaround: http://bugs.php.net/bug.php?id=239 47 75 48 if (isWindows()) { 49 $mode .= "-"; // suppress locking, or 50 } elseif ($this->_handler != 'gdbm') { // gdbm does it internally 51 $mode .= "d"; // else use internal locking 52 } 53 } 54 while (($dbh = dba_open($this->_file, $mode, $this->_handler)) < 1) { 55 if ($watchdog <= 0) 56 break; 57 flush(); 58 // "c" failed, try "w" instead. 59 if (substr($mode,0,1) == "c" and file_exists($this->_file)) 60 $mode = "w"; But I don't see what I should change in here in order to make it work. I don't see where $mode ever gets set to "c" and how I can make any changes to make it work.... -- Alan Hoyle - al...@un... - http://www.alanhoyle.com/ "I don't want the world, I just want your half." -TMBG Get Horizontal, Play Ultimate. |
From: Reini U. <ru...@x-...> - 2005-04-18 20:02:05
|
Alan Hoyle schrieb: > On Mon, 18 Apr 2005 at 20:02, Reini Urban wrote: > >>> lib/DbaDatabase.php:54: Error[256]: >>> dba_open(/home/alanh/html/wiki/pages/pagedb.gdbm,c): Driver >>> initialization failed for handler: gdbm: File open error >>> file: /home/alanh/html/wiki/pages/pagedb.gdbm >>> mode: c >>> handler: gdbm >>> >>> Any suggestions as to what to try? >> >> >> Yes, >> see the current sozurce of lib/DbaDatabase.php what I had to do to >> workaround gdbm bugs. >> if "c" fails try "w" with the second try. >> Only Windows needs "-" > > Hi Reini, > I'm looking at the version of DbaDatabase.php that was included in > phpwiki-1.3.11_rc1 and I don't understand quite what you mean. > > I see the following code fragment on lines 46-53: > > 46 if (check_php_version(4,3,0) and (strlen($mode) == 1)) { > 47 // PHP 4.3.x Windows lock bug workaround: > http://bugs.php.net/bug.php?id=239 47 75 > 48 if (isWindows()) { > 49 $mode .= "-"; // suppress > locking, or > 50 } elseif ($this->_handler != 'gdbm') { // gdbm > does it internally > 51 $mode .= "d"; // else use > internal locking > 52 } > 53 } > 54 while (($dbh = dba_open($this->_file, $mode, > $this->_handler)) < 1) { > 55 if ($watchdog <= 0) > 56 break; > 57 flush(); > 58 // "c" failed, try "w" instead. > 59 if (substr($mode,0,1) == "c" and > file_exists($this->_file)) > 60 $mode = "w"; > > But I don't see what I should change in here in order to make it work. > I don't see where $mode ever gets set to "c" and how I can make any > changes to make it work.... There are only two changes which affect you. The first is not important: * Randomizing (a la Ethernet collision handling) competing locks. $secs = 0.5 + ((double)rand(1,32767)/32767); sleep($secs); $watchdog -= $secs; This changed the loop. * Second, the change from "c" to "w" if the first "c" fails, in line 59-60 gdbm errors are all about locking and its improper handling within php. gdbm itself works marvelous. -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ http://phpwiki.org/ |
From: Alan H. <ala...@gm...> - 2005-04-18 20:39:34
|
On 4/18/05, Reini Urban <ru...@x-...> wrote: > There are only two changes which affect you. > The first is not important: > * Randomizing (a la Ethernet collision handling) competing locks. > $secs =3D 0.5 + ((double)rand(1,32767)/32767); > sleep($secs); > $watchdog -=3D $secs; > This changed the loop. > * Second, the change from "c" to "w" if the first "c" fails, > in line 59-60 >=20 > gdbm errors are all about locking and its improper handling within > php. gdbm itself works marvelous. Perhaps I should be a bit more detailed in my report: ----- error page ----- Fatal Error: lib/DbaDatabase.php:56: Error[256]: dba_open(/home/alanh/html/wiki/pages/pagedb.gdbm,w): Driver initialization failed for handler: gdbm: File open error file: /home/alanh/html/wiki/pages/pagedb.gdbm mode: c handler: gdbm lib/DbaDatabase.php:56: Error[256]: dba_open(/home/alanh/html/wiki/pages/pagedb.gdbm,w): Driver initialization failed for handler: gdbm: File open error file: /home/alanh/html/wiki/pages/pagedb.gdbm mode: c handler: gdbm ----- end error page ----- It's not giving me a failover to the "w" in the first place. If I put a "$mode =3D "w" right before the "while" statement, I get the same error except with w's instead of c's in the "mode" line. -alan --=20 Alan Hoyle - al...@un... - http://www.alanhoyle.com/ "I don't want the world, I just want your half." -TMBG Get Horizontal, Play Ultimate. |