Search code examples
phppdoinformix

php_pdo_informix on php 5.3


I have a php app that uses PDO extensively and have a new client that has informix. Previously we used php 5.2 without any problems but switching to PHP 5.3 is unavoidable so:

Anybody has found out a way of using php_pdo_informix on php5.3 or is it completely obsolete and I must find another alternative?

This is needed for our test environments (CentOS) but developers currently work on windows we have a similar problem. There is a php_pdo_informix.dll but it is compiled against php5.2 and refuses to load on php5.3

Does anybody have a dll for php5.3?

Thx

I've already tried:

$ sudo pecl install pdo_informix
pecl.php.net is using a unsupported protocol - This should never happen.
pecl/PDO_INFORMIX requires package "pear/PDO"
No valid packages found
install failed

or

pecl install --alldeps pdo_informix

shows that it depends on pear/PDO but it has been deprecated in 5.3

and with explicit versions 1.2.6 , 1.2.7 to no avail

Even if I try to install pear/PDO it fails with many errors which is expected as there are many API changes in PHP that break.

This kind of errors appear when trying to install pdo beforehand: (some lines ommitted)

$ sudo pecl install  pdo
WARNING: "pecl/PDO" is deprecated in favor of "channel://http://svn.php.net/viewvc/php/php-src/trunk/ext/pdo//ext/PDO"
downloading PDO-1.0.3.tgz ...
Starting to download PDO-1.0.3.tgz (52,613 bytes)
.............done: 52,613 bytes
12 source files, building
<...more lines ...>
/tmp/pear/temp/PDO/pdo_dbh.c: In function 'pdo_stmt_instantiate':
/tmp/pear/temp/PDO/pdo_dbh.c:410:8: error: 'zval' has no member named 'refcount'
/tmp/pear/temp/PDO/pdo_dbh.c:411:8: error: 'zval' has no member named 'is_ref'
/tmp/pear/temp/PDO/pdo_dbh.c: In function 'pdo_stmt_construct':
/tmp/pear/temp/PDO/pdo_dbh.c:435:6: error: 'zend_fcall_info' has no member named 'object_pp'
/tmp/pear/temp/PDO/pdo_dbh.c:458:6: error: 'zend_fcall_info_cache' has no member named 'object_pp'
/tmp/pear/temp/PDO/pdo_dbh.c: In function 'zim_PDO_setAttribute':
/tmp/pear/temp/PDO/pdo_dbh.c:752:12: error: 'zval' has no member named 'refcount'
/tmp/pear/temp/PDO/pdo_dbh.c: In function 'zim_PDO_getAttribute':
/tmp/pear/temp/PDO/pdo_dbh.c:818:28: error: 'zval' has no member named 'refcount'
/tmp/pear/temp/PDO/pdo_dbh.c: In function 'pdo_hash_methods':
/tmp/pear/temp/PDO/pdo_dbh.c:1122:24: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
/tmp/pear/temp/PDO/pdo_dbh.c:1126:20: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
make: *** [pdo_dbh.lo] Error 1
ERROR: `make' failed

If I try to install a specific pdo_informix version I get this output:

pecl install --alldeps  http://pecl.php.net/get/PDO_INFORMIX-1.2.6.tgz 
downloading PDO_INFORMIX-1.2.6.tgz ...
Starting to download PDO_INFORMIX-1.2.6.tgz (65,676 bytes)
.................done: 65,676 bytes
WARNING: "pecl/PDO" is deprecated in favor of "channel://http://svn.php.net/viewvc/php/php-  src/trunk/ext/pdo//ext/PDO"
downloading PDO-1.0.3.tgz ...
Starting to download PDO-1.0.3.tgz (52,613 bytes)
...done: 52,613 bytes
12 source files, building
running: phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
<more lines>
<same output as above>

Solution

  • As of Sept, 2022, you can follow the instructions in the official PHP documentation:

    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 Installation of PECL extensions 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.