码迷,mamicode.com
首页 > 数据库 > 详细

php sqlite 权限

时间:2015-03-31 06:24:20      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:

php官网一段留言

IMPORTANT! just a note: 

weird behaviour when doing an exec on a sqlite db!!!

if want to execute a query on a sqlite db with exec, and your dbfile already was e.g. mode 777, and you get some php errors saying

"SQLite3::exec(): unable to open database file in ...."

and you get crazy while debugging, just add write üermissions to the whole directory for the user the webserver/php runs.

this behaviour makes absolutely NO sense, and is a source of frustration.
at least a more meaningful errormessage would be nice.
i couldnt figure out why sqlite needs write permissions for the whole dir instead of only one file. this is stupid and must be a bug!
(to be secure you have to create a directory with write permissions only for php/apache)

大意是:把数据库放到一个另外文件夹(不影响其他文件),设置读写权限

纠结的是:数据库和数据库所在的文件夹都要可写(可能是因为写数据库时,需要建立一个临时文件)

具体用到就是 chmod

php sqlite 权限

标签:

原文地址:http://www.cnblogs.com/d20062303732/p/4379708.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!