I have a system that has used PHP to build a GDBM file that is then referenced by Apache to perform basic authentication. It has been running since 1999 with many versions of apache and PHP until now when I am doing an upgrade to match corporate policy.
If I run php from the command line (specifying the appropriate php.ini file) then the DBA functionality works correctly.
However when it is called from within Apache at the point it calls dba_open(...) from PHP I get:
Warning: dba_open(/etc/httpd/conf/users.tmp,n): Driver initialization failed for handler: gdbm: File open error in /var/www/phpinc/bxxx.inc
PHP was built with the following command:
./configure --with-iconv --with-mysql --with-mysql-sock=/var/run/mysql/mysql.sock --with-apxs2=/usr/local/apache2/bin/apxs --with-gdbm --enable-mbstring --with-gd --enable-dba
And I only added the --enable-dba based on some other comments.
gdbm_dump was failing and reporting:
gdbm_dump: gdbm_open failed: Unexpected end of file
but now having managed to rebuild the GDBM datafile using command-line PHP it works correctly - hence it seems there might be (or was) a character encoding issues or something similar
Inside apache it fails with:
[authn_dbm:error] [pid 14104:tid 140279619360512] (20014)Internal error (specific information not available): [client 10.160.9.247:52710] AH01754: could not open dbm (type GDBM) auth file: /etc/httpd/conf/users, referer: xxxxx
I am assuming it has to be something to do with a library mismatch on the machine a but I can't think of any more ways to debug it. Any help or suggestions would be much appreciated.