Skip to content

Instantly share code, notes, and snippets.

@nasrulhazim
Last active August 25, 2019 19:12
Show Gist options
  • Save nasrulhazim/7449d6dd7d09c36fd8b57dbe2abf8bcb to your computer and use it in GitHub Desktop.
Save nasrulhazim/7449d6dd7d09c36fd8b57dbe2abf8bcb to your computer and use it in GitHub Desktop.
Create PDO for Informix for MacOS

Download targeted Informix Client SDK

Extract the installer:

$ tar -xvf filename.tar

Install the Client SDK:

$ cd /path/to/extracted/installer
$ ./installclientsdk

Install all the packages, including OAT.

Download latest PDO_INFORMIX Pecl driver here and extract it:

$ wget https://pecl.php.net/get/PDO_INFORMIX-1.3.3.tgz
$ tar -xvf PDO_INFORMIX-1.3.3.tgz

Compile for pdo_informix.so

$ cd PDO_INFORMIX-1.3.3.tgz
$ phpize
$ ./configure --with-pdo-informix=/Applications/IBM/informix
$ make
$ make test
$ make install

Enable pdo_informix.so in PHP 7.3:

$ cd /usr/local/etc/php/7.3/conf.d
$ echo "extension=pdo_informix.so" > pdo_informix.ini

Update your ~./bash_profile

# Informix Client SDK
export INFORMIXDIR="/Applications/IBM/informix"
export DYLD_LIBRARY_PATH="/Applications/IBM/informix/lib:/Applications/IBM/informix/lib/cli:/Applications/IBM/informix/lib/esql"
umask 002

Then

$ source ~/.bash_profile

Verify pdo_informix is loaded:

$ php -m | grep informix
pdo_informix
@nasrulhazim
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment