Informix Functions (PDO_INFORMIX)

简介

PDO_INFORMIX is a driver that implements the PHP Data
Objects (PDO) interface to enable access from PHP to Informix databases.

安装

To build the PDO_INFORMIX extension, the Informix Client SDK 2.81 UC1 or
higher must be installed on the same system as PHP. The Informix Client
SDK is available from the » IBM Informix
Support Site.

PDO_INFORMIX is a » PECL extension, so
follow the instructions in PECL 扩展库安装 to install the
PDO_INFORMIX extension. Issue the configure command
to point to the location of your Informix Client SDK header files and
libraries as follows:

bash$ ./configure --with-pdo-informix=/path/to/SDK[,shared]

The configure command defaults to the value of the
INFORMIXDIR environment variable.

Scrollable cursors

PDO_INFORMIX supports scrollable cursors; however, they are not enabled
by default. To enable scrollable cursor support, you must either set
ENABLESCROLLABLECURSORS=1 in the corresponding ODBC
connection settings in odbc.ini or pass
the EnableScrollableCursors=1 clause in the DSN
connection string.

The embedded PDO in php since 5.1+ is INCOMPATIBLE with the latest PDO_MYSQL and PDO_INFORMIX, etc. I just spent 2 days working on this. This solution works on numerous versions of Linux I've tried as well as SunOS and HPUX.

The basic issue, getting this message when running PHP with PDO and tryingto get PDO_INFORMIX working, but having a version conflict:

"PHP Fatal error: PDO: driver informix requires PDO API version 20060409;this is PDO version 20060511 in Unknown on line 0"

The "embedded" PDO that is within PHP since version 5.1 CONFLICTS with thePDO the PEAR/PECL modules are expecting.

1) Rebuild PHP with no pdo (--disable-pdo) (and you can't have any stuff like --with-mysql-pdo, either)2) Then use PEAR/PECL to install PDO: pear install pdo3) then use PEAR/PECL to install PDO_INFORMIX: pear install --alldeps pdo_informix4) make sure your php.ini extensions_dir points to the directory where these are placed5) then add these references to php.ini: extensions=pdo.so extensions=pdo_informix.so extensions=pdo_mysql.so (etc.)

In case that you loaded the extension, in solaris systems, and you are getting something similar to this:PHP Warning: PHP Startup: Unable to load dynamic library '/opt/php547/lib/php/extensions/no-debug-non-zts-20100525/pdo_informix.so' - ld.so.1: php: fatal: libifgls.so: DF_1_NOOPEN tagged object may not be dlopen()'ed in Unknown on line 0

In this case set the following Environment variables:export INFORMIXDIR=/path/to/Informix/CSDK/export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$INFORMIXDIR/lib:$INFORMIXDIR/lib/cli:$INFORMIXDIR/lib/esql

I've just built PHP 5.2.11 with pdo_informix support on Slackware 13.0. I had to use the following options in order to disable pdo from being compiled in (notice the difference in the --without-pdo-sqlite option from previous post):

--disable-pdo option --without-pdo-sqlite option

I also could not use the --with-sigchild option which caused problems with phpize.

This fixed the informix -11001 error that I was getting. I was also getting an informix -23101 error (something about locale mismatches), but it was because I was not completely removing the compiled in pdo support.