472,789 Members | 1,046 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,789 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 2234
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: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.