Bug #17559 Updated: dba_open() fails when using the db3 handler.
| From: | bugs at timj dot co dot uk | Date: | Wed, 10 Jul 2002 10:55:10 +0000 |
| Subject: | Bug #17559 Updated: dba_open() fails when using the db3 handler. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-13717@lists.php.net to get a copy of this message | ||
ID: 17559
Updated by: bugs@timj.co.uk
Reported By: oceanwave-nospam-@linkline-nospam-.com
Status: Open
Bug Type: DBM/DBA related
Operating System: Windows XP Professional
PHP Version: 4.2.1
New Comment:
Further to my above comment, it also does the same thing with
--with-db2.
Previous Comments:
------------------------------------------------------------------------
[2002-07-10 05:15:40] bugs@timj.co.uk
Have experienced the same problem on Linux.
With two i386 machines, here were our findings:
Machine that fails
------------------
- Red Hat 7.2 base
- Apache: 1.3.26 compiled from source
- PHP: 4.2.1 compiled from source using (amongst others) --with-db3
Machine that works
------------------
- Red Hat 7.3 base
- Apache: 1.3.23-14 (Red Hat binary RPM)
- PHP: 4.2.1 compiled from source using (amongst others) --with-db3
------------------------------------------------------------------------
[2002-06-20 23:51:24] php@eli.users.panix.com
I've got code that that uses dba_open() with the db3
handler and works with php4.1.2 on apache 1.3.19; yet the
same code fails with php4.1.2 and apache 1.3.26.
if(extension_loaded("dba")) {
echo "okay - dba extension loaded<br>\n";
if(strlen($DB)) { # set in httpd.conf
$dbtype = $DB;
echo "okay - db is $DB<br>\n";
} else {
$dbtype = "db2";
echo "okay - using db2<br>\n";
}
$dbfile = "/usr/local/httpd/search/test-tuidb"; # info by tui
if(file_exists($dbfile)) {
echo "okay - tuidb file $dbfile found<br>\n";
$id = dba_open($dbfile, "r", $dbtype);
if ($id) {
echo "okay - open worked<br>\n";
$key = "tui";
if(dba_exists($key, $id)) {
$keys = dba_fetch($key, $id);
echo "okay - 'tui' entry is $keys<br>\n";
} else {
echo "bad - no 'tui' entry found<br>\n";
}
} else {
echo "bad - open failed; ";
echo "PHP error message: $php_errormsg<br>\n";
}
} else {
echo "bad - tuidb file not found<br>\n";
}
} // if dba extension loaded
else {
echo "bad - no dba extension<br>\n";
}
On the working machine:
okay - dba extension loaded<br>
okay - db is db3<br>
okay - tuidb file /usr/local/httpd/search/test-tuidb found<br>
okay - open worked<br>
okay - 'tui' entry is YES OH YES
On the non-working machine:okay - dba extension loaded<br>
okay - db is db3<br>
okay - tuidb file /usr/local/httpd/search/test-tuidb found<br>
<br>
<b>Warning</b>: driver initialization failed in
<b>/usr/local/httpd/html/winamp/testit.html</b> on line <b>23</b><br>
bad - open failed; PHP error message: <br>
On both machines PHP was built with the same config options,
apache was built with the same config options, the apache
config files are largely the same (hostname and IP are
changed), php conf files are identical. If I swap binaries
and leave all the conf and html files as is, I can duplicate
either situation on either machine.
Here's how I configured PHP:
'./configure' \
'--with-db3' \
'--with-apxs=/usr/sbin/apxs' \
'--with-mysql=/usr/' \
'--enable-bcmath' \
'--with-config-file-path=/etc/httpd/conf' \
"$@"
Here's how I configured Apache:
./configure \
"--with-layout=Mine" \
"--enable-module=all" \
"--enable-shared=max" \
"--with-perl=/usr/bin/perl" \
"$@"
For kicks I just built PHP 4.2.1: same broken behaviour.
It sure looks like something in the new apache is breaking
this, but what? Why?
------------------------------------------------------------------------
[2002-06-01 23:37:47] oceanwave-nospam-@linkline-nospam-.com
When calling dba_open on Win32 (Apache version 1.3.24) using the db3
handler, it returns the following:
Warning: driver initialization failed in d:\docroot\dbawrite.php on
line 2
The code is as follows (part of a news system):
function loadarticledb() {
return(dba_open("./nnews/articles.dbm", "c", "db3");
}
The function should create articles.dbm if it doesn't exist, as stated
in the docs. I have php_dba.dll included as an extension (specified in
php.ini), and phpinfo()'s dba section shows that dba is enabled and the
db3 handler is the only available handler. I've been working at fixing
this for a very long time, and any help is appreciated.
Thanks in advance!
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=17559&edit=1