Installing PHP PDO Informix on RHEL/CentOS

When I install PHP, I realized I applied the following command.
$ yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo

On a CentOS, Red Hat Enterprise Linux or Fedora machine and their derivitives, this is a simple as running this command, either using sudo or as the root user:
$ yum install php-pear
The pecl command can then be found at /usr/bin/pecl. On other Linux distributions it should be a similar process.

It doesn’t mean you’re not read to compile. Then again, here’s the issue.
$ yum install php-devel

1) download last version of PDO
$ mkdir pdo
$ cd pdo
$ wget http://pecl.php.net/get/PDO_INFORMIX-1.3.3.tgz

2) uncompress
$ tar zxf PDO_INFORMIX-1.3.3.tgz
$ cd PDO_INFORMIX-1.3.3/

3) set your INFORMIXDIR
$ export INFORMIXDIR=/opt/IBM/informix/4.10

3) execute phpize
$ phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
configure.in:3: warning: prefer named diversions
configure.in:3: warning: prefer named diversions

3) execute the ./configure
$ ./configure
configure: loading site script /usr/share/site/x86_64-unknown-linux-gnu
checking for grep that handles long lines and -e… /usr/bin/grep
checking for egrep… /usr/bin/grep -E
checking for a sed that does not truncate output… /usr/bin/sed
checking for gcc… gcc

Add a module file under
$ cd /etc/php.d
$ vi 30-pdo_informix.ini
(Prefix number is optional)
And add the line:
extension=pdo_informix.so

Restart Apache server.

2 thoughts on “Installing PHP PDO Informix on RHEL/CentOS

  1. Hi G MOHR,

    Thanks for the post on pdo_informix. I have tried to use pdo_informxi in php but I am encountering issues.

    My trial is:
    OS: CentOS 7.8.2003
    php: PHP 5.4.16 (cli) (built: Apr 1 2020 04:07:17)
    PDO_INFORMIX-1.3.3

    after compiling the pdo_informix 1.3.3, I did a make test and I am getting the below error:

    PHP Warning: PHP Startup: Unable to load dynamic library ‘/opt/SOFTWARE/PDO_INFORMIX-1.3.3/modules/pdo_informix.so’ – /opt/SOFTWARE/PDO_INFORMIX-1.3.3/modules/pdo_informix.so: undefined symbol: pdo_parse_params in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library ‘/opt/SOFTWARE/PDO_INFORMIX-1.3.3/modules/pdo_informix.so’ – /opt/SOFTWARE/PDO_INFORMIX-1.3.3/modules/pdo_informix.so: undefined symbol: pdo_parse_params in Unknown on line 0

    and then failed all 39 tests.

    May I ask more details on the environments that you used to install pdo_informix?
    OS version
    php version (from source or yum?)

    Many thanks

    Cheers,
    Adrian

  2. Hi, G MOHR,

    May I ask which Linux OS did you use for the above?
    Did you use the standard php installed from yum? Or did you compile php fromsource code?

    Thanks

Leave a comment