Home > Archive > PHP DB > December 2004 > RE: [PHP-DB] Problem with permissions Win32 dba_open
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
RE: [PHP-DB] Problem with permissions Win32 dba_open
|
|
| Bastien Koert 2004-12-29, 3:56 am |
| 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
>
| |
|
| "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
| |
| Bastien Koert 2004-12-29, 8:55 pm |
| 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
>
| |
|
|
"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
| |
| Bastien Koert 2004-12-30, 3:56 pm |
| 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
>
| |
|
| 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:[color=darkred]
> make sure in the general tab that the read only checkbox is NOT checked
>
> bastien
>
|
|
|
|
|