Apache doesn't support Berkeley DB Btree, so you can't manipulate use db4 as the type of database if you want to do DBM authentication with Apache.
gdbm seemed to work fine though, even though it supposedly using Btree instead of hash. It makes you wonder why Apache would use hash for one dbmtype versus btree for another.
So since Apache and PHP don't have options to choose the method for the Berkeley DBs, you are out of luck.