Php+sqlite3 to sqlite3 the database is located in the directory 777 permissions are appropriate?

Source: Internet
Author: User
Tags sqlite database
Title, using PHP and sqlite3 to build a small application, using Nginx as a reverse proxy server, spawn-fcgi as a fcgi service, the database and PHP and static files are not in the same directory.
Now Nginx and spawn-fcgi both use nobody user work, if the database directory can not read/write, PHP will prompt can not open the database ... (This is probably the error), so you have to set the permissions of the database directory to 777, and the question is, is this really okay?
The online search method is to change the permissions to 777, but I see my rails application within the DB directory permissions are 775, the database file permissions are more stringent, as if 664 ... I checked the web for rails passenger (I deployed with passenger) to work with the owner of the application path, so should I use the creator of the PHP application file to perform the fcgi service?
It would be better if it was unsafe to raise the cause of insecurity.

Reply content:

Title, using PHP and sqlite3 to build a small application, using Nginx as a reverse proxy server, spawn-fcgi as a fcgi service, the database and PHP and static files are not in the same directory.
Now Nginx and spawn-fcgi both use nobody user work, if the database directory can not read/write, PHP will prompt can not open the database ... (This is probably the error), so you have to set the permissions of the database directory to 777, and the question is, is this really okay?
The online search method is to change the permissions to 777, but I see my rails application within the DB directory permissions are 775, the database file permissions are more stringent, as if 664 ... I checked the web for rails passenger (I deployed with passenger) to work with the owner of the application path, so should I use the creator of the PHP application file to perform the fcgi service?
It would be better if it was unsafe to raise the cause of insecurity.

Set the SQLite database file to Nobody all. Permissions of 644 or even 600 are OK.

# chown Nobody:Nobody xxx.sqlite# chmod 600 xxx.sqlite
  • Related Article

    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.