问题
I am trying to connect to an Informix db remotely via php7.0 I've found the driver https://pecl.php.net/package/PDO_INFORMIX/1.3.3
Downloaded the .tar.gz. and extracted it. Prepped the php files via phpize and ran ./configure as explained in:
http://php.net/manual/en/ref.pdo-informix.php
However, it crashes with the following error:
checking for PDO includes... configure: error: Cannot find php_pdo_driver.h.
I know that PDO has been a core PHP lib for a while and probably the C header file is named differently than the one referenced in the lib.
Any ideas where to go from here? It's been a very rough day. Installing the Informix SDK is a nightmare for itself anyway. Can't even find the installation dir.
回答1:
The Informix SDK has been carefully and specifically designed by IBM to ruin your day.
- The whole set lives under
/opt/IBM/informix
by default - Add
/opt/IBM/informix/lib/cli
and/opt/IBM/informix/lib/esql
to your dynamic linker lookup paths. On Fedora you can do this by putting them in a new file/etc/ld.so.conf.d/informix.conf
- You need to set the environment variable
INFORMIXDIR
. On Fedora you may add a new file/etc/profile.d/informix.sh
and addexport INFORMIXDIR=/opt/IBM/informix
- Edit
/opt/IBM/informix/etc/sqlhosts
and put your basic connection information there. In the most simple case it has only one line that readsYOUR_SERVER_NAME\tonsoctcp\tYOUR_DB_NAME\tpdap-np
. Note thatpdap-np
is actually port 1526 which is also the Informix "Turbo"-Driver tcp port. See your/etc/services
. - Get the environment-changes going, e.g. by a reboot if you did them globally.
- I can't remember the include-dir but you probably need
/opt/IBM/informix/include
in yourCFLAGS
's-I
来源:https://stackoverflow.com/questions/44972106/php7-0-informix-db-connectors