您的位置:首页 > 编程语言 > PHP开发

PHP使用出现 Fatal error: Class 'SQLite3' not found

2016-05-06 14:10 811 查看
<?php

//phpinfo();
/**
* Simple example of extending the SQLite3 class and changing the __construct
* parameters, then using the open method to initialize the DB.
*/

class MyDB extends SQLite3
{
function __construct()
{
$this->open('test.db');
}
}

$db = new MyDB();

$db->exec('CREATE TABLE foo (bar STRING)');
$db->exec("INSERT INTO foo (bar) VALUES ('This is a test')");

$result = $db->query('SELECT bar FROM foo');
var_dump($result->fetchArray());

?>

运行的时候出现异常:
Class 'SQLite3' not found in
。。。。。。

需要在php.ini中修改下面的配置


extension_dir = "C:/php/php7.0/ext"

extension=php_pdo_sqlite.dll
extension=php_sqlite3.dll
sqlite3.extension_dir = "C:/php/php7.0/ext"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: