如何更新与PHP捆绑在一起的SQLite版本 [英] How to update the SQLite version bundled with PHP

查看:75
本文介绍了如何更新与PHP捆绑在一起的SQLite版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

PHP 5.5与SQLite 3.7.7.1捆绑在一起.

PHP 5.5 comes bundled with SQLite 3.7.7.1.

此后,已有约20个SQLite的较新版本,并且www.sqlite.org建议进行升级.就我而言,我需要仅自SQLite 3.8.0起可用的功能.

There have been ~ 20 newer releases of SQLite since then, and www.sqlite.org recommends to upgrade. In my case, I need a feature available only since SQLite 3.8.0.

据我了解,SQLite在PHP 5.5中并未动态链接,但sqlite源代码已编译为SQLite的内置PHP PDO驱动程序.

As far as I understood, SQLite is not dynamically linked in PHP 5.5 but the sqlite source code is compiled into the built-in PHP PDO driver for SQLite.

有没有一种方法可以在PHP中使用当前的SQLite版本而无需从源代码重建PHP(例如,以某种方式动态链接sqlite.dll)?

Is there a way to use a current SQLite version in PHP without rebuilding PHP from source (e.g., somehow dynamically linking sqlite.dll)?

推荐答案

我可以生成一个新的php_pdo_sqlite.dll,放入包含当前版本(3.8.1)的SQLite的现有PHP 5.5 Windows安装中:

I could produce a fresh php_pdo_sqlite.dll to drop into an existing PHP 5.5 Windows installation that includes the current version (3.8.1) of SQLite:

我遵循了不错的分步指南,使用Windows在Windows上构建PHP Visual Studio 2012 Express(可从 http://www.microsoft.com/获得. com/en-us/download/details.aspx?id = 34673 ).

I followed the nice step-by-step guide to build PHP on Windows using Visual Studio 2012 Express (available from http://www.microsoft.com/en-us/download/details.aspx?id=34673).

在PHP 5.5来源中,我已用 http://www.sqlite.org/download.html .

In the PHP 5.5 sources, I have replaced the outdated sqlite amalgamation file ext\sqlite3\libsqlite\sqlite.c by the current one from http://www.sqlite.org/download.html.

我使用了configure --enable-pdo=shared --with-pdo-sqlite=shared.

这将创建php_pdo_sqlite.dll,我可以将其放入现有的PHP 5.5安装中,替换该文件的先前(捆绑)版本.

This creates php_pdo_sqlite.dll that I could drop into an existing PHP 5.5 installation, replacing the previous (bundled) version of that file.

<?php
$dbh = new PDO('sqlite:test1.sqlite');
print_r("SQLite version " . $dbh->query('select sqlite_version()')->fetch()[0]);
$dbh = null;
?>

确认:

SQLite version: 3.8.1

这篇关于如何更新与PHP捆绑在一起的SQLite版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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