tags:

views:

170

answers:

1

The error-Warning: sqlite_query() [function.sqlite-query]: attempt to write a readonly database is coming whenever i try to insert values into a sqllite 1.1 database thru php program. php version is 5.2.

A: 

attempt to write a readonly database

Beyond the version issues that have already been pointed out, this error happens under two circumstances:

  1. The file is owned by the same user running PHP, and permissions on the file are not wide enough to allow PHP to modify the file
  2. The file is not owned by the same user running PHP, and permissions on the file are not wide enough to allow PHP to modify the file

Correct either ownership or permissions, and the problem will be resolved.

Charles