: This article describes how to read and write sqlite databases in linux. For more information about PHP tutorials, see. Recently I learned about linux, and I happen to have a php project to do. so I plan to configure the environment in linux.
However, the website is blank after running. After debugging, it is found to be a problem with the sqlite database.
Install sqlite extension
Apt-get install php5-sqlite
View the/var/log/apach2/error. log file and find the following line:
SQLSTATE [HY000]: General error: 8 attempt to write a readonly database
It seems that there is no write permission, and the chmod modification permission is writable.
Chmod g + w db. sqlite
The error message "cannot open the data file" is returned.
SQLSTATE [HY000]: General error: 14 unable to open database file
Change file owner
Chown www-data db. sqlite
This time is enough. However, if this is not the case, you can change it to the 777 permission.
The above section describes the permissions for reading and writing sqlite databases in linux, including related content, and hopes to help those who are interested in PHP tutorials.