宽屏模式

"SQLSTATE: General error: 8 attempt to write a readonly database"

今天写完一篇学习笔记,在提交的时候报错:
无法写入只读数据库

"SQLSTATE[HY000]: General error: 8 attempt to write a readonly database"

去百度了一下, 发现这个问题很少有提问的, 而且全是英文, 凭着自己半吊子的四级英语, 终于, 在一个pdo手册里面, 发现了一些线索;

The problem was with the file permissions. As root I could read and write the database from the sqlite3 command line monitor. But Apache was unable to write the database.
Changed the permissions to 755 wwwrun:wwrun and it all works OK!

于是我查看了项目的权限以及所有者;

发现,vendor目录的所有者是root, 尝试命令 chown www:www vendor -R之后, 再添加文章就不会报错了;
PS:

目前上有一个未解之谜:解决问题期间发现,添加文字时候报错, 但实际上文章都添加成功了,删除文章时也提示失败,但是实际删除是成功的;

Larwas
请先登录后发表评论
  • latest comments
  • 总共0条评论