How to enable the PDO driver for sqlite3 in php?(如何在 php 中启用 sqlite3 的 PDO 驱动程序?)
问题描述
我的 SQLite 是 3.4.0 版:图片
My SQLite is version 3.4.0: image
但是我的 phpinfo 对 SQLitev3 的 PDO 支持没有启用/列出:图片
However my phpinfo's PDO support for SQLitev3 is not enabled/listed: image
如何启用它?我通过 XAMPP 安装了我的网络服务器.
How can I enable it? I installed my web server via XAMPP.
推荐答案
我认为sqlite3的PDO驱动叫做'sqlite',所以你已经安装好了.sqlite2 驱动程序较旧.
I think that the PDO driver for sqlite3 is called 'sqlite', so you already have it installed. The sqlite2 driver is older.
PDO_SQLITE 是一个驱动程序实现 PHP 数据对象 (PDO)允许访问 SQLite 3 的接口数据库.
PDO_SQLITE is a driver that implements the PHP Data Objects (PDO) interface to enable access to SQLite 3 databases.
在 PHP 5.1 中,SQLite 扩展也为 SQLite 2 提供驱动程序数据库;虽然在技术上不是PDO_SQLITE 驱动程序的一部分,它行为相似,因此记录在案旁边.SQLite 2 驱动程序提供 PDO 主要是为了使它更容易导入旧版 SQLite 2数据库文件到应用程序使用更快、更高效的SQLite 3 驱动程序.结果,SQLite 2 驱动程序没有那么丰富作为 SQLite 3 驱动程序.
In PHP 5.1, the SQLite extension also provides a driver for SQLite 2 databases; while it is not technically a part of the PDO_SQLITE driver, it behaves similarly, so it is documented alongside it. The SQLite 2 driver for PDO is provided primarily to make it easier to import legacy SQLite 2 database files into an application that uses the faster, more efficient SQLite 3 driver. As a result, the SQLite 2 driver is not as feature-rich as the SQLite 3 driver.
来自 http://php.net/manual/en/ref.pdo-sqlite.php
这篇关于如何在 php 中启用 sqlite3 的 PDO 驱动程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 php 中启用 sqlite3 的 PDO 驱动程序?


- SoapClient 设置自定义 HTTP Header 2021-01-01
- PHP Count 布尔数组中真值的数量 2021-01-01
- 从 PHP 中的输入表单获取日期 2022-01-01
- Laravel 仓库 2022-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- 没有作曲家的 PSR4 自动加载 2022-01-01
- 如何定位 php.ini 文件 (xampp) 2022-01-01
- 正确分离 PHP 中的逻辑/样式 2021-01-01
- Mod使用GET变量将子域重写为PHP 2021-01-01
- 带有通配符的 Laravel 验证器 2021-01-01