permission denied to open dbm

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I can't open a dbm in my webspace, the message I get is

Warning: dba_open(./subscribers.db): failed to open stream: Permission
denied in
on line 15
Couldn't open database

The relevant code is ;

    function addsubscriber ($name,$email){
        $db=dba_open("./subscribers.db","c","db4") or die("Couldn't open
        if (!dba_exists($name))
                dba_insert ($name,$email,$db);
    function listentries(){
        while ($key){
            print ("$key : dba_fetch($key)");
    addsubscriber ($name,$email);

Do dbm files need a suffix (i.e. .db) ? Can anyone help, or is it a
permission issue I have to take up with my hosts ?

Thank you

Re: permission denied to open dbm

charlie fortune wrote:

Quoted text here. Click to load it
Quoted text here. Click to load it
Quoted text here. Click to load it

No. On a Unix system, and even on a Micorosft Windows machine, file
extensions are just a convention and do not (AFAIK) affect access rights.

The webserver typically runs as a different user on a shared system -
usually a user (say web_uid) whom is not allowed to login. Looks like a
straight permissions error.

Since web_uid cannot write to
/home/fhlinux199/f/ the
sensible thing would be to create a different directory writable by all (as
a normal user you can't create a dir only writable by web_uid).

If possible I would try to make it outside of the document root so people
can't download it. If this is not possible you can protect it using a
..htaccess file, or if this is not practical, default apache configs
typically disallow access to files beginning .ht



Site Timeline