PDOException 找不到驱动程序(SQLite)

PDOException could not found driver (SQLite)

我检查了 php_pdo_sqlite.dll,php_sqlite3.dll 存在于 C:\xampp\php\ext 文件夹中 这些行是 php.ini file:

extension=php_pdo_sqlite.dll 
extension=php_sqlite3.dll

这里是 phpinfo()

中的 pdo_sqlite 部分
 pdo_sqlite

    PDO Driver for SQLite 3.x   enabled
    SQLite Library  3.8.4.3

 PDO

PDO support enabled
PDO drivers mysql, sqlite

这里是 PDO 连接语句:

 try
        {
            $this->dbh = new PDO("C:/xampp/htdocs/WP/webfilterdb.db");//exception
            $this->dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
            $this->resultBool=true;
        }
        catch (PDOException $e) {
            $this->resultBool=false;
            $this->resultString=$e->getMessage();
        }

Exp 消息:

PDOException: could not find driver in C:\xampp\htdocs\WP\DbOperations\Connection.php5

我搜索了很多但无法识别丢失

您的连接代码不正确试试这个

  $this->dbh = new PDO("sqlite:webfilterdb.db");