如何在 php 中启用 sqlite3 的 PDO 驱动程序? [英] How to enable the PDO driver for sqlite3 in php?

查看:23
本文介绍了如何在 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 驱动程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆