PHP7.0 & Informix DB connectors

北城余情 提交于 2019-12-13 01:18:22

问题


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 add export 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 reads YOUR_SERVER_NAME\tonsoctcp\tYOUR_DB_NAME\tpdap-np. Note that pdap-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 your CFLAGS's -I


来源:https://stackoverflow.com/questions/44972106/php7-0-informix-db-connectors

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!