尝试在Windows上使用PHP创建SQLite数据库时出错

时间:2015-05-21 21:26:34

标签: php database sqlite permissions

我正在关注此页面上的SQLite教程http://www.tutorialspoint.com/sqlite/sqlite_php.htm

但是我在运行此代码时遇到错误

<?php
   class MyDB extends SQLite3
   {
      function __construct()
      {
         $this->open('test.db');
      }
   }
   $db = new MyDB();
   if(!$db){
      echo $db->lastErrorMsg();
   } else {
      echo "Opened database successfully\n";
   }
?>

我收到此错误

Fatal error: Uncaught exception 'Exception' with message 'Unable to open
database: unable to open database file' in C:\inetpub\wwwroot\cdb.php:6
Stack trace:
#0 C:\inetpub\wwwroot\cdb.php(6): SQLite3->open('test.db')
#1 C:\inetpub\wwwroot\cdb.php(9): MyDB->__construct()
#2 {main} thrown in C:\inetpub\wwwroot\cdb.php on line 6

所以错误是程序无法创建数据库,但是我在inetpub / wwwroot文件夹上,IIS对它有权限,并且turorial没有提及任何有关权限问题的内容。知道为什么会这样吗?

0 个答案:

没有答案