Re: Problem with permissions Win32 dba_open

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Well - after much experimentation, hair-pulling, and chasing of red herrings 
I have discovered  the error of my ways.  :oD

Despite my 4 PHP reference books I eventually turned to the PHP Manual (in 
.chm form) and it seems that the dba_open() function was modified for PHP 
4.3.0 et seq, to include modifiers for the mode parameter, which handle 
database locking, ie 'l', 'd', '-' and 't'.

So, the solution to my problem was nothing at all to to with file 
permissions, security or sharing folders - it was DBA locking by default.

Along the way, some of you newbies may like know of a few other pit-falls:

1.  Using db3 as the handler, rather than inifile or flatfile, it's 
necessary to supply the _full_ path to your database file, rather than a 
relative path (which actually works with the other handlers).

2.  If the database parameter is supplied without a path (relative or 
otherwise), a lock file is placed into the folder from which the script is 
run, while the database file is planted squarely into the folder from which 
php.exe is executed, in my case C:\PHP.  Weird - took me a while to sus. 
that one!  (What about the setting of doc_root in php.ini?  Makes no 
difference.)

3. Use single, rather than double quotes for dba_open() parameters.  In my 
original test, I used double quotes (below) and, of course, \t was 
interpolated!

Cheers,
Ian
(New Year's resolution - RTFM!)

"Ian" <news@xxxxxxxxxxxxx> originally wrote:
> 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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux