How to update the SQLite version bundled with PHP - php

PHP 5.5 comes bundled with SQLite 3.7.7.1.
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.
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.
Is there a way to use a current SQLite version in PHP without rebuilding PHP from source (e.g., somehow dynamically linking sqlite.dll)?

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:
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).
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.
I used configure --enable-pdo=shared --with-pdo-sqlite=shared.
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;
?>
confirms:
SQLite version: 3.8.1

Related

PHP and MYSQL supported versions for upgrade

We are trying to upgrade the PHP website that connects to MYSQL DB. We are trying to use the following version of Apache, PHP,MYSQL and PHPMyadmin
PHP : 5.6.6
MYSQL : 5.6
Open SSL: v1.0.2a
Apache Server : 2.4.12
PHP MYADMIN : 4.4.1.1
PHP 5.6.13 is the latest version. New versions are PHP are released very frequently (5.6.9 -->5.6.10 --> 5.6.11 --> 5.6.13).
I am trying to check the PHP compatibility with MYSQL, Apache and PHPMyadmin. Is there any PHP/MYSQL compatibility/supported versions for upgrade.
we are trying to select the correct versions of PHP and MYSQL for the upgrade.
Thanks
Ashok
Wikipedia: XAMPP
Under Components you'll find a list of all components including PHP, apache, MySQL and phpmyadmin with version numbers included, as far as I know, they use the latest stable version of each component so you'll have a good overview of what versions to pick.
EDIT: They use the latest versions that work together, so that should do the trick of finding out what versions to use.

Upgraded from PHP 5.3 to PHP 5.6.5 and now no php_oci8.dll

I use php_oci8.dll in our application to access an Oracle 8 database server. I upgraded our PHP version from 5.3 to 5.6.5 and now there is no php_oci8.dll in the ext/ folder.
Can I just copy it from the old version?
php_oci8.dll is a very old library used with very old version of Oracle
Now there is a newer version for this library, like php_oci8_11g
The question is : what is the version of Oracle that you use ?
From http://php.net/manual/en/oci8.requirements.php
The OCI8 1.4 extension is included with PHP 5.3, PHP 5.4 and PHP 5.5. It is also available from PECL.
Read: not incliuded in PHP 5.6 (which is a good thing, not pulling in every single DB interface into the main tree)
Just download that stuff from PECL.
You might need to rebuild it from source, though, if whatever Oracle DB client Libraries you use don't match the needs of the OCI8 in its current version
EDIT: Don't do this, OP. Are you really using Oracle 8i? That has seen its last update in 2003 and should not be used for security reasons, any more. Seriously, how do you even run this on a modern Operating system? Or do you have a Windows XP machine running as a server exposed to the internet somewhere?!

How to enable php_mssql.dll extension in xampp 1.8.x

I'm using xampp-win32-1.8.3-1-VC11-installer and i enabled php_mssql.dll extension in php.ini by remove ;
I copy php_mssql.dll to xampp\php\ext
and ntwdblib.dll to xampp\apache\bin
i got 2 files above in old of xampp version.
But when i start my apache in xampp then i get
How to fix that thanks
It announced from php website http://php.net/manual/en/intro.mssql.php
These functions allow you to access MS SQL Server database.
This extension is not available anymore on Windows with PHP 5.3 or later.
SQLSRV, an alternative extension for MS SQL connectivity is available from Microsoft: ยป http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx.
Since XAMPP 1.8.0 its used PHP 5.4.4 and php_mssql.dll extension is not available anymore on windows with PHP 5.3 or later.
So you can't use this library to your new XAMPP although you get it from your old XAMPP.
You must use alternative extension to connect to MS SQL Server database like SQLSRV.
See also ::
http://php.net/manual/en/intro.mssql.php
http://stackoverflow.com/questions/7402713/how-to-get-mssql-work-with-php-5-3
Your php version from XAMPP 1.8.3 is PHP 5.5.15, so you must use "php_sqlsrv_55_nts.dll" or "php_sqlsrv_55_ts.dll". Those files can be downloaded from http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=20098`.
Note :: see also the information on Details section to help you choose file that you must download
This link about documentation to code with sqlsrv library
http://php.net/manual/en/book.sqlsrv.php
Windows PHP extensions are neither forward nor backward compatible between second-level PHP versions. That means you cannot use a PHP 5.3 extension in PHP 5.4 and vice-versa.
As you're running XAMPP 1.8.3 and this is one of the first PHP bundles with the VC11-PHP5.5 builds you'll have to find a VC11-PHP5.5 compatible extension somewhere else.
I've just checked another WAMP bundle called EasyPHP, but they don't ship the MS SQL extension with their VC11-PHP5.5 bundle either.
I can't help with finding a compatible extension, though.
You could also build the extension yourself if that is an option for you.

connect php with mssql while using iis

I have successfully configured php in IIS. sample php pages working fine. now i want to connect it to sql server i tried it by downloading a mssql .dll file in ext folder,I also tried by installing a extension for windows driver, then also it is not working. please help to sort out this issue. I am Using php5.3.19 for the same.
In order to use PHP 5.3 with SQL Server (2005 and above), you will need the Microsoft Drivers for PHP for SQL Server. There are two versions available: 2.0 and 3.0. 3.0 includes support for SQL Server 2012 and PHP 5.4.
You can find instructions for installing the dlls and interfacing with SQL Server in a TechNet article.
To install the extensions, you must move them into your ext folder and add a line to php.ini to load them, like the following:
extension=php_sqlsrv_53_nts_vc9.dll
Once this is done, restart the web server and load phpinfo in order to see if the extension has loaded. If it has loaded correctly, you should see a "sqlsrv" section in PHPInfo.
When the time comes for you to begin writing PHP that connects to SQL Server, make sure you have installed the native client. The current version is the SQL Server 2012 Native Client. References for the API are available on TechNet and PHP.net.
Finally, consider upgrading to PHP 5.4. The 3.0 versions of the drivers support 5.4 but the 2.0 versions do not; if you cannot install 3.0 on your system, you can find a 5.4-compatible version of the DLL (sqlsrv-5.4-nts-snap.zip or
sqlsrv-5.4-ts-snap.zip) on PHP.net. I have had good results with these versions.

MongoDB PHP Driver and MongoDB compatibility check

In PHP how to check if the CORRECT mongodb PHP driver is installed for the corresponding mongodb.
The link below tells how to check if mongodb PHP driver is installed, but does not tell if that driver is correct/compatible for the corresponding mongodb.
http://stackoverflow.com/questions/11134959/check-if-mongodb-php-driver-is-installed
For example, if I have PHP version 5.3.10 and have mongodb 2.2.2, the command
echo extension_loaded("mongo") ? "loaded\n" : "not loaded\n";
will say loaded, however, mongodb is not going to work properly because for mongodb 2.2.2, you need the latest PHP not 5.3.10
I think, you're talking about driver, not PHP itself. PHP has no built-in support to access \Mongo* classes until you compile and load special extension.
Since you're talking about the latest version of MongoDB, I think you couldn't use some parts of its functionality because you had some old driver (say, 1.2.12). When you upgraded PHP, you, probably, updated the driver to the latest (1.3.0) stable version as well. That version of driver was submitted a couple of days ago, and it supports all the latest features MongoDB provides.
Anyway, if you'd like to check which version of driver you have, you can call phpinfo(8) from your PHP and look though the output for the mongo section, where the version of driver is displayed.

Categories