Fixing PHP SQLite database is locked warning - Unable to execute statement: database is locked
Apparently this error is caused by not closing the database after using it.
Warning: SQLite3::query(): Unable to execute statement: database is locked.
You can close the database using the following code:
$db->close(); unset($db); // you can also set a busy timeout for sqlite $db->busyTimeout(3000);