在我的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