Reputation: 206
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
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