Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

RE: [PHP-DB] Problem with permissions Win32 dba_open
is your ms firewall turned on? ms sp2 screws a lot of stuff up..

bastien

>From: "Ian" <news@baringo.co.uk>
>To: php-db@lists.php.net
>Subject: [PHP-DB] Problem with permissions Win32 dba_open
>Date: Tue, 28 Dec 2004 23:36:08 -0000
>
>Hi all,  Season's Greetings!
>
>I am testing my PHP scripts locally under XP Home SP2 / apache 1.3.23 / PHP
>4.3.10 but I can't get a simple DBM script to work.  No problem running it
>on my remote site, under Unix with gdbm though.
>
>Locally, phpinfo() gives:
>
>DBA support: enabled
>Supported handlers: cdb cdb_make db3 inifile flatfile
>
>This encourages me to think that I could open a database with db3, but I
>just can't get passed the dba_open command, which always fails with
>"Permission denied".
>
>$db = dba_open("C:\Apache\htdocs\test.db", "c" , "db3")  // for example
>
>What am I doing wrong please?
>
>Thanks for your help,
>Ian
>
>PS This appears to be a fixed bug (http://bugs.php.net/bug.php?id=28122)
>but
>I still get "permission denied".  Why?
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>

Report this thread to moderator Post Follow-up to this message
Old Post
Bastien Koert
12-29-04 08:56 AM


Re: [PHP-DB] Problem with permissions Win32 dba_open
"Bastien Koert" <bastien_k@hotmail.com> wrote
> is your ms firewall turned on? ms sp2 screws a lot of stuff up..
>
> bastien

Thanks bastien,

I'm running Norton IS 2005, with Windows Firewall switched off.

Whether or not I turn off the Norton firewall results in the same error:

<?php $db = dba_open( "C:/Apache/htdocs/test.db", "c" , "db3" ); ?>

Notice: dba_open(): read: 0x12f550, 256: Permission denied in
c:\apache\htdocs\admin\dba.php on line 1

Notice: dba_open(): C:/Apache/htdocs/test.db: Permission denied in
c:\apache\htdocs\admin\dba.php on line 1

Warning: dba_open(C:/Apache/htdocs/test.db,c): Driver initialization failed
for handler: db3: Permission denied in c:\apache\htdocs\admin\dba.php on
line 1

However, this command does create a zero-byte file  -
C:\Apache\htdocs\test.db.

Ian

Report this thread to moderator Post Follow-up to this message
Old Post
Ian
12-29-04 01:55 PM


Re: [PHP-DB] Problem with permissions Win32 dba_open
have you set the permissions in the folders? Right click on the folder and
choose Properties...then set the appropraiate permissions

bastien

>From: "Ian" <news@baringo.co.uk>
>To: php-db@lists.php.net
>Subject: Re: [PHP-DB] Problem with permissions Win32 dba_open
>Date: Wed, 29 Dec 2004 09:15:01 -0000
>
>"Bastien Koert" <bastien_k@hotmail.com> wrote 
>
>Thanks bastien,
>
>I'm running Norton IS 2005, with Windows Firewall switched off.
>
>Whether or not I turn off the Norton firewall results in the same error:
>
><?php $db = dba_open( "C:/Apache/htdocs/test.db", "c" , "db3" ); ?>
>
>Notice: dba_open(): read: 0x12f550, 256: Permission denied in
>c:\apache\htdocs\admin\dba.php on line 1
>
>Notice: dba_open(): C:/Apache/htdocs/test.db: Permission denied in
>c:\apache\htdocs\admin\dba.php on line 1
>
>Warning: dba_open(C:/Apache/htdocs/test.db,c): Driver initialization failed
>for handler: db3: Permission denied in c:\apache\htdocs\admin\dba.php on
>line 1
>
>However, this command does create a zero-byte file  -
>C:\Apache\htdocs\test.db.
>
>Ian
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>

Report this thread to moderator Post Follow-up to this message
Old Post
Bastien Koert
12-30-04 01:55 AM


Re: [PHP-DB] Problem with permissions Win32 dba_open
"Bastien Koert" <bastien_k@hotmail.com> wrote:

> have you set the permissions in the folders? Right click on the folder and
> choose Properties...then set the appropraiate permissions
>
> bastien
[snip]

Thanks, Bastien.

Altering permissions doesn't appear to work, at least not the way it seems
to be implemented with Service Pack 2.  Are you aware of the current method?

What seems to be necessary, after right-clicking a folder and selecting
Properties, is to choose the Sharing tab.  XP then presents you with options
for Local sharing and security (by dragging the folder into a new folder
called Shared Documents) and for Network and security.

Now, my PC isn't used by anyone else and isn't connected to a LAN, so which
method is appropriate for an apache web server htdocs folder?  I haven't
tried moving htdocs to this Shared Documents folder, that seems mad!, so
just for a laugh, I selected my apache folder and ticked the boxes for
'sharing this folder on the network' and 'allow network users to change my
files'.  A progress box appeared, to indicate that file permissions were
being altered.  Great! I thought.

My test script STILL fails with 'Permission denied', even though it makes a
zero-byte file in the right place.

Amended test script reads:

$dbh = dba_open( "C:/Apache/htdocs/test.db", "c" , "db3" );

dba_replace("fred", "test", $dbh);
dba_sync($dbh);
dba_close($dbh);

Response is:

Notice: dba_open(): read: 0x12f550, 256: Permission denied in
c:\apache\htdocs\admin\dba.php on line 3

Notice: dba_open(): C:/Apache/htdocs/test.db: Permission denied in
c:\apache\htdocs\admin\dba.php on line 3

Warning: dba_open(C:/Apache/htdocs/test.db,c): Driver initialization failed
for handler: db3: Permission denied in c:\apache\htdocs\admin\dba.php on
line 3

Warning: dba_replace(): supplied argument is not a valid DBA identifier
resource in c:\apache\htdocs\admin\dba.php on line 5

Warning: dba_sync(): supplied argument is not a valid DBA identifier
resource in c:\apache\htdocs\admin\dba.php on line 6

Warning: dba_close(): supplied argument is not a valid DBA identifier
resource in c:\apache\htdocs\admin\dba.php on line 7

Ian

Report this thread to moderator Post Follow-up to this message
Old Post
Ian
12-30-04 08:56 PM


Re: [PHP-DB] Problem with permissions Win32 dba_open
make sure in the general tab that the read only checkbox is NOT checked

bastien

>From: "Ian" <news@baringo.co.uk>
>To: php-db@lists.php.net
>Subject: Re: [PHP-DB] Problem with permissions Win32 dba_open
>Date: Thu, 30 Dec 2004 12:54:49 -0000
>
>"Bastien Koert" <bastien_k@hotmail.com> wrote:
> 
>and 
>[snip]
>
>Thanks, Bastien.
>
>Altering permissions doesn't appear to work, at least not the way it seems
>to be implemented with Service Pack 2.  Are you aware of the current
>method?
>
>What seems to be necessary, after right-clicking a folder and selecting
>Properties, is to choose the Sharing tab.  XP then presents you with
>options
>for Local sharing and security (by dragging the folder into a new folder
>called Shared Documents) and for Network and security.
>
>Now, my PC isn't used by anyone else and isn't connected to a LAN, so which
>method is appropriate for an apache web server htdocs folder?  I haven't
>tried moving htdocs to this Shared Documents folder, that seems mad!, so
>just for a laugh, I selected my apache folder and ticked the boxes for
>'sharing this folder on the network' and 'allow network users to change my
>files'.  A progress box appeared, to indicate that file permissions were
>being altered.  Great! I thought.
>
>My test script STILL fails with 'Permission denied', even though it makes a
>zero-byte file in the right place.
>
>Amended test script reads:
>
>$dbh = dba_open( "C:/Apache/htdocs/test.db", "c" , "db3" );
>
>dba_replace("fred", "test", $dbh);
>dba_sync($dbh);
>dba_close($dbh);
>
>Response is:
>
>Notice: dba_open(): read: 0x12f550, 256: Permission denied in
>c:\apache\htdocs\admin\dba.php on line 3
>
>Notice: dba_open(): C:/Apache/htdocs/test.db: Permission denied in
>c:\apache\htdocs\admin\dba.php on line 3
>
>Warning: dba_open(C:/Apache/htdocs/test.db,c): Driver initialization failed
>for handler: db3: Permission denied in c:\apache\htdocs\admin\dba.php on
>line 3
>
>Warning: dba_replace(): supplied argument is not a valid DBA identifier
>resource in c:\apache\htdocs\admin\dba.php on line 5
>
>Warning: dba_sync(): supplied argument is not a valid DBA identifier
>resource in c:\apache\htdocs\admin\dba.php on line 6
>
>Warning: dba_close(): supplied argument is not a valid DBA identifier
>resource in c:\apache\htdocs\admin\dba.php on line 7
>
>Ian
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>

Report this thread to moderator Post Follow-up to this message
Old Post
Bastien Koert
12-30-04 08:56 PM


Re: [PHP-DB] Problem with permissions Win32 dba_open
Unchecking the read only box made no difference.   A zero byte test database
file is created and dba_open() results in 'Permission denied'.  However, if
the file is given a relative path (eg ../test.db), instead of an absolute
address (eg C:/Apache/htdocs/test.db), the Permission denied warning is not
generated.  Also, the dba_replace() function doesn't result in a warning
either - but the test database remains at zero bytes and, of course,
dba_fetch() can't find any records.

I have given up on DB3 now, because I've discovered that both the 'inifile'
and 'flatfile' handlers give me the results I need from my Win32 testbed.  I
wonder why DB3 fails - perhaps it's a bug after all, as I mentioned in my
original post

Thanks for your patience,
Ian

"Bastien Koert" <bastien_k@hotmail.com> wrote:
> make sure in the general tab that the read only checkbox is NOT checked
>
> bastien
> 

Report this thread to moderator Post Follow-up to this message
Old Post
Ian
12-31-04 01:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP DB archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:40 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.