I have a SQLite database that I am using for a website. The problem is that when I try to INSERT INTO
it, I get a PDOException
SQLSTATE[HY000]: General error: 8 attempt to write a readonly database
I SSH'd into the server and checked permissions, and the database has the permissions
-rw-rw-r--
I'm not that familiar with *nix permissions, but I'm pretty sure this means
- Not a directory
- Owner has read/write permissions (that's me, according to
ls -l
)
- Group has read/write permissions
- Everyone else only has read permissions
I also looked everywhere I knew to using the sqlite3
program, and found nothing relevant.
Because I didn't know with what permissions PDO is trying to open the database, I did
chmod o+w supplies.db
Now, I get another PDOException
:
SQLSTATE[HY000]: General error: 14 unable to open database file
But it ONLY occurs when I try to execute an INSERT
query after the database is open.
Any ideas on what is going on?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…