SQLITE, can't write?

Discussion in 'General' started by Anthony Cleaves, May 4, 2016.

  1. Anthony Cleaves

    Anthony Cleaves New Member

    Hey all, curious to know what's going on here.

    I got a site that uses SQLITE, however the website doesn't seem to be able to write to it?

    The folder is called db
    [email protected]:/var/www/clients/client2/web5/web/application# stat db
      File: ‘db’
      Size: 4096            Blocks: 8          IO Block: 4096   directory
    Device: fe01h/65025d    Inode: 265463      Links: 2
    Access: (0755/drwxr-xr-x)  Uid: ( 5008/    web5)   Gid: ( 5008/ client2)
    Access: 2016-05-04 15:50:57.039656690 -0400
    Modify: 2016-04-18 14:39:30.449883677 -0400
    Change: 2016-05-04 16:59:43.223769003 -0400
    Birth: -
    And then the DB

    [email protected]:/var/www/clients/client2/web5/web/application/db# ls -al | grep jg
    -rwxr-xr-x 1 web5 client2 43008 Apr 25 09:45 jg.sqlite
    [email protected]:/var/www/clients/client2/web5/web/application/db# stat jg.sqlite
      File: ‘jg.sqlite’
      Size: 43008           Blocks: 88         IO Block: 4096   regular file
    Device: fe01h/65025d    Inode: 265466      Links: 1
    Access: (0755/-rwxr-xr-x)  Uid: ( 5008/    web5)   Gid: ( 5008/ client2)
    Access: 2016-05-04 16:01:30.359713252 -0400
    Modify: 2016-04-25 09:45:02.255657790 -0400
    Change: 2016-05-04 15:48:47.475643964 -0400
    Birth: -
    I have even tried 644 for both file and folder with no joy

    The file permissions have not changed since moving the website over to this platform.

    It can read the database absolutely fine, just fails to write to it.
  2. Jesse Norell

    Jesse Norell Active Member

    The needed permissions probably depend on how your website runs, eg. php-fpm or fastcgi. Try adding group write permissions, ie. mode 664 for the file and 775 for the directory. (could try just the file first, I don't know if sqlite creates/renames files, so maybe the directory doesn't need group write permission)

    Fwiw, mode 644 for the directory would be bad, it doesn't let anything change into the directory (e.g. can't open files underneath there).
    Anthony Cleaves likes this.
  3. Anthony Cleaves

    Anthony Cleaves New Member

    I think this was a case of Dyslexia at it's finest.

    I was trying 755 instead of 775, and 644 instead of 664.

    This fixed it, thank you sir.

Share This Page