SQLite3无法打开数据库

时间:2013-11-16 20:38:53

标签: php sqlite

在我的PHP文件(register.php)中,我有以下内容:

class DB extends SQLite3{
    function __construct(){
        $this->open('/usr/share/nginx/www/cgi-bin/db/userpass.db');
    }
}

$db = new DB();

$stmt = $db->prepare('INSERT INTO userpass VALUES(:user, :encrypted_pass)');
$stmt->bindValue(':user', $user);
$stmt->bindValue(':encrypted_pass', $encrypted_pass);

if($stmt->execute() == FALSE) die(1); //line 25

引发:

Warning: SQLite3Stmt::execute(): Unable to execute statement: unable to open database file in /path/to/register.php on line 25

我正在使用Raspbian存储库中的nginx,PHP5,SQLite3和php5-sqlite3

修改:输出ls -l /usr/share/nginx/www/cgi-bin/db

total 4
-rw-rw-rw- 1 root root 3072 Nov 11 19:17 userpass.db

0 个答案:

没有答案