473,322 Members | 1,268 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

permission denied to open dbm

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 /home/fhlinux199/f/fortunesgreenradio.co.uk/user/htdocs/scripts/footy_subscribers.php
on line 15
Couldn't open database

The relevant code is ;

<?php
$name="fred";
$email="fr**@frog.com";
function addsubscriber ($name,$email){
$db=dba_open("./subscribers.db","c","db4") or die("Couldn't open
database");
if (!dba_exists($name))
dba_insert ($name,$email,$db);
dba_close($db);
}

function listentries(){
$db=dba_open("subscribers.db","r","db4");
$key=dba_firstkey($db);
while ($key){
print ("$key : dba_fetch($key)");
$key=dba_nextkey($db);
}
}

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
Jul 17 '05 #1
1 2273
charlie fortune wrote:
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
/home/fhlinux199/f/fortunesgreenradio.co.uk/user/htdocs/scripts/footy_subscribers.php on line 15 Couldn't open database

The relevant code is ;
<snip>
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 ?


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/fortunesgreenradio.co.uk/user/htdocs/scripts/ 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

HTH

C.

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Taishi | last post by:
New user of SQL Everything is on the same machine My error is close to the bottom After reading it today, I can see there is a problem with 2 dbases 'PUBS' and 'Master' There are also some...
1
by: vikas.khengare | last post by:
Hi Friends.... I have AJAX code which giving "Permission denied to call method XMLHttpRequest.open" error. This error fired by FireFox 1.0 and IE 6 and with Tomacat 5.x. This code work very...
3
by: fniles | last post by:
In our ASP page, we call XMLHttp to download XML files. When calling our page using localhost (localhost/myWebSite/myPage.htm), it works, but when calling using the IP address of the web server...
2
by: laredotornado | last post by:
Hi, I'm trying to use the xmlHttpReq object to contact a URL on my server. But I'm getting a JS "Permission denied" error at the indicated line. What does it mean and how can I get around it? ...
1
by: Charlie | last post by:
I am trying to make an XMLHttpRequest which violates the default "same- origin"policy in Firefox. I checked the archives and found a method that should work but it does not. Below is the test code...
1
by: doctorhardik | last post by:
other interesting thing i observe during my work which i describe below: i am using dotproject2.0.4 on fc3. it is working fine. but i want to generate pdf file report during this time i face...
6
by: Andy2500 | last post by:
Hi, I'd like to upload an image to a folder, then I have 3 diffrents examples but all of them give an error "failed to open stream: Permission denied", althrough the C:\Inetpub\wwwroot is not...
0
by: private.anders | last post by:
Hi David! Really need assistance since I have been struggling with a problem long time now. I am running a web application on a Win 2003 Std (Active Directory). Everything works fine. I have...
0
by: private.anders | last post by:
Really need your assistance since I have been struggling with a problem long time now. I am running a web application on a Win 2003 Std (Active Directory). Everything works fine. I have...
2
by: swethak | last post by:
Hi, when i run my code it gives error as fopen(lib/providers//provider.RVLogic.php): failed to open stream: Permission denied in F:\Facebook\furniture11\Data...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.