sebu
sebu

Reputation: 206

How should I set SQLite3 DB permissions on a live website?

I'm trying to set up a tiny web app on a live website using SQLite 3.

In order to get PHP to talk to it on my local server, I had to do chmod 777 on the database file, or it wouldn't allow me to write to it.

If it's on a live site, though, I don't want it to be 777 because anybody can download the database (if they know/guess the path).

How can I restrict access to it and still be able to write to the database file?

Upvotes: 0

Views: 265

Answers (1)

sebastian
sebastian

Reputation: 36

you can restrict the database download by .htaccess rule.

put an .htaccess file in the db directory with this:

Order deny,allow deny from all

then, nobody can download the database.

Upvotes: 2

Related Questions