SQLite Forum

Database is read-only but file permissions seem correct - config issue?
Login

Database is read-only but file permissions seem correct - config issue?

(1) By SQLight on 2020-12-29 16:10:08 [source]

I copied my database file and the PHP that interacts with it to a new server. The code connects and reads from the database, but the Insert function gives these warnings and fails to write to the database:

Warning: SQLite3::query(): Unable to execute statement: attempt to write a readonly database in /var/www/clients/client1/web59/web/hi-score/gallery.php on line 129

Warning: Cannot modify header information - headers already sent by (output started at /var/www/clients/client1/web59/web/hi-score/gallery.php:129) in /var/www/clients/client1/web59/web/hi-score/gallery.php on line 92

My webhost has made the files fully accessible (probably something like chmod 777) and I'm wondering if it could be a config issue with sqlite?

(2) By Keith Medcalf (kmedcalf) on 2020-12-29 19:09:38 in reply to 1 [link] [source]

Is the directory containing the database writable?

(3) By SQLight on 2020-12-29 22:27:22 in reply to 2 [link] [source]

It seems it was not writable to the server 'user'. Running whoami from PHP returned 'www-data', which was neither the owner or group. The admin has amended and it seems to be working now. Thank you!