Unable to write to a chmod 777 database file on SQlite3 via php 5.3.0 Unable to write to a chmod 777 database file on SQlite3 via php 5.3.0 sqlite sqlite

Unable to write to a chmod 777 database file on SQlite3 via php 5.3.0


The folder containing the SQLite file must be writeable by the web user, if you want to make changes to it. It's not enough that the .db file is writeable.

See Why can't DBD::SQLite insert into a database through my Perl CGI script?


Try adding the sqlite user to the group which owns the /var/www directories, or manually chown -R user:user /var/www/ , the directory needs to be writable by the sqlite user.


Pay attention, if you run PHP with CLI, you must use "sudo -u www-data php script.php" so PHP can write on the sqlite.