Sqlite database read/write permission issues in linux

Source: Internet
Author: User
: 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.