I was wondering if anybody here has had success getting PHP to interact with a GDBM database? I have to get info out of one for a project I'm doing at work and have no idea where to start.

    you need to have gdbm installed (natch) and when you compile php you need the two following switches for your ./configure script:

    --with-gdbm --with-db

    Then you just hit it and go.

      Scott Marlowe wrote:

      you need to have gdbm installed (natch) and when you compile php you need the two following switches for your ./configure script:

      --with-gdbm --with-db

      Then you just hit it and go.

      Scott,

      I've already got gdbm and db support compiled in (I'm not the sysadmin but have been told that it was done). The problem I'm having is that none of the examples seem to work with the db I'm using. I can pull up a key but get no corresponding value with it.

        Oh, sorry. Not sure what's up then. Are you sure it's not currupted or something? Other than that, I really don't know.

          a year later
          1. Verify you have gdbm with phpinfo:
            <?php phpinfo(); ?>

          You should see
          Configure Command '--with-gdbm'
          And:
          dba DBA support enabled
          Supported handlers gdbm

          1. Make sure the gdbm file is readable by WORLD (especially the web server). AND that the directory (and parent directories) are readable/executible by WORLD. My problem was my gdbm was permission 0640 (rw-r-----) and the webserver couldn't find it.
            Write a Reply...