I'm developing a Wordpress site with SQLite as my database. The db file is located on wp-content/database/.ht.sqlite and I don't know which file permissions I should give to it. I tried following some guides on file permissions for wordpress like this one but now I can't access wp-admin, so I believe it has something to do with the database.

What are the correct permissions for the SQLite database file?

  • I would avoid putting it in a publicly accessible folder, right now anybody can download that file and open it up on their machine with local tools to extract data and conduct attacks. I also would avoid using it on any host that doesn't have SSD drives, and stick to a single machine, your DB performance will be IO limited, and performance may drop as the size of your sqlite database increases – Tom J Nowell Dec 1 '16 at 14:29
  • I understand, but my University only allows me to use Wordpress with SQLite, which I can put into my folder on the FTP server. I'm actually just curious about the permissions as this will be set by the IT department of the University I suppose, but I'm testing the setup on my machine first. – JefersonFG Dec 1 '16 at 14:36
  • 1
    That sounds incredibly problematic, WordPress doesn't support sqlite out of the box. You would be better off hosting it elsewhere, but at the bare minimum, move the database file out of the public html folder. While its inside wp-content or the root folder, the only secure permissions are 000 – Tom J Nowell Dec 1 '16 at 14:40
  • May I ask you to elaborate on the problems? Maybe I can explain it to the IT department and see if I can at least move the database to another location, or see if they can enable MySQL for me. – JefersonFG Dec 1 '16 at 14:55
  • I can put the URL of your sqlite database into my browser and download it, I now have your database with all your content, users, emails, etc etc – Tom J Nowell Dec 1 '16 at 16:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.