if the dir isn't writable - db cannot be opened. but no debug messages about "fix your dir perms".

Issue #74 resolved
Former user created an issue

Originally reported on Google Code with ID 74

What steps will reproduce the problem?
1. if the directory where db and phpliteadmin.php is placed (root dir) is not writable
- it is impossible to execute any query on db. the debug message is "Warning: SQLite3::query()
[sqlite3.query]: Unable to execute statement: unable to open database file in <file
path> on line 669"
2. when i chmoded root dir to 770 and chowned it to apache.remort the bug is gone.
db file itself was writeable. it was showned like it was opened in RW mode.
3. it's a known, very hard to find-out issue with directory where db is placed.

What is the expected output? What do you see instead?
i saw some checks whether root dir is writable or not, but it seems to be useless,
cause i find-out the issue by myself. web interfase told me nothing about that my root
dir is not writable.

What version of the product are you using? On what operating system?
gentoo, define("VERSION", "1.9.0");

Please provide any additional information below.

it seems not to be working as well with russian symbols, but i will try to handle it,
if not - prepare for new bugs.

Reported by remort.net on 2011-12-13 19:15:10

Comments (11)

  1. Dane Iracleous

    ``` I think it is required that the containing directory of the SQLite database be writable. SQLite needs to keep track of transactions and a lock file in the directory. ```

    Reported by `diracleo` on 2011-12-16 05:17:32

  2. Former user Account Deleted

    ``` 16.12.2011 11:18, phpliteadmin@googlecode.com пишет:

    phpliteadmin should be able to diagnose this properly and write an error on screen like this: 'error: the containing directory is not writable.' ```

    Reported by `remort.net` on 2011-12-16 05:45:55

  3. Former user Account Deleted

    ``` I have to agree, the error message needs to be better. This had me stumped for a while until I found this issue thread and then I found I had to change my directory permissions. ```

    Reported by `cody@seekom.com` on 2011-12-19 21:17:01

  4. Former user Account Deleted

    ``` again. 1.9.1 i open the Db, it writes that it's in the RW mode, but i cant make a table. i chowned my website dir with www-data user and group recursively on Ubuntu and DB became writable.

    make some initial tests while loading a DB, please. ```

    Reported by `master@remort.net` on 2012-03-31 17:41:14

  5. Christopher Kramer
    Thanks for this issue report. It's still an issue in current 1.9.3
    I'll fix it soon so it'll make it into 1.9.4
    

    Reported by crazy4chrissi on 2012-11-07 20:46:00 - Status changed: Accepted

  6. Christopher Kramer
    Here is a patch for this issue.
    
    It adds another property to a DB. Besides writable and readable, there is now also
    writable_dir, which is true if the containing directory is writable.
    
    DBs are only marked [rw] if the directory is writable as well.
    
    If a db-file is writable but the dir not, it displays a warning message on the front
    page of the Db saying:
    "Attention: The database-file itself is writable, but to write into it, the directory
    needs to be writable as well. This is because SQLite puts temporary files in there
    for locking."
    
    @dreadnaut: Do you have suggestions or comments or should I commit it like this?
    Or someone else?
    

    Reported by crazy4chrissi on 2013-03-13 22:50:21

    <hr> * Attachment: i74_writabledir-r354.patch

  7. Christopher Kramer
    This issue was closed by revision r355.
    

    Reported by crazy4chrissi on 2013-03-13 23:38:15 - Status changed: Fixed

  8. Christopher Kramer
    Thanks dreadnaut for having a look at my patch.
    Just committed it.
    
    (I think this issue is not relevant for Windows. At least I do not know of a way to
    have a writable file in a non-writable folder in Windows. But I'm not an expert on
    NTFS.)
    

    Reported by crazy4chrissi on 2013-03-13 23:41:18

  9. Log in to comment