PHP SQLite permissions

Source: Internet
Author: User
Tags php website sqlite sqlite db

PHP website a message

important!just a note:weird behaviour when doing an exec on a sqlite db!!!ifWant to execute a query on a SQLite db with Exec, and your dbfile already is e.g. mode777, and youGetsome PHP errors saying"sqlite3::exec (): Unable to open database file in ...." and youGetCrazy whiledebugging, just add writeüermissions to the whole directory forThe user the webserver/PHP runs. ThisBehaviour makes absolutely NO sense, and isa source of frustration.at least a more meaningful errormessage would being nice.i couldnt figure outWhy SQLite needs Write permissions forThe whole dir instead of only one file. This  isStupid and must be a bug!(To is secure you has to create a directory with Write permissions only forPhp/apache)

The main idea is: put the database into a different folder (do not affect other files), set read and Write permissions

The tangled is: the database and the database is in the folder to be writable (perhaps because the database is written, you need to create a temporary file)

The specific use is chmod

PHP SQLite permissions

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.