Informix 関数 (PDO_INFORMIX)

はじめに

PDO_INFORMIX は、PHP から Informix データベースへのアクセスを可能にするための PHP Data Objects (PDO) インターフェイス を実装したドライバです。

インストール手順

PDO_INFORMIX 拡張モジュールをビルドするには、PHP と同じシステムに Informix Client SDK 2.81 UC1 以降がインストールされている必要があります。 Informix Client SDK は、» IBM Informix Support Site で入手できます。

PDO_INFORMIX は » PECL 拡張モジュールです。 そのため、PDO_INFORMIX 拡張モジュールをインストールするには PECL 拡張モジュールのインストール の手順に従います。 Informix Client SDK ヘッダファイルおよびライブラリの場所を指定するため、 次のように configure コマンドを実行します。

   bash$ ./configure --with-pdo-informix=/path/to/SDK[,shared]
configure コマンドのデフォルトは、 環境変数 INFORMIXDIR の値となります。

スクロール可能なカーソル

PDO_INFORMIX は、スクロール可能なカーソルをサポートしています。 しかし、デフォルトでは有効になっていません。 スクロール可能なカーソルのサポートを有効にするには、 odbc.ini での対応する ODBC 接続設定で ENABLESCROLLABLECURSORS=1 を設定するか、 DSN 接続文字列に EnableScrollableCursors=1 句を指定しなければなりません。

目次

add a note add a note

User Contributed Notes 6 notes

up
3
alan dot acosta at gps dot com dot co
10 years ago
Take care, with php-5.2.4 --with-pdo-informix=shared,/home/informix
doesn't work, just says:
Notice: Following unknown configure options were used:
--with-pdo-informix=shared,/home/informix
up
1
cwgraven at gmail dot com
8 years ago
I noticed that SQLite is installed by php by default...oh and it happens to use PDO. So dont forget to use --without-sqlite.

My successful config looks like this:

./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs --with-curl --with-xsl --disable-pdo --without-sqlite
up
0
user at nowhere dot com
5 months ago
In case that you  loaded the extension, in solaris systems, and you are getting something similar to this:
PHP Warning:  PHP Startup: Unable to load dynamic library '/opt/php547/lib/php/extensions/no-debug-non-zts-20100525/pdo_informix.so' - ld.so.1: php: fatal: libifgls.so: DF_1_NOOPEN tagged object may not be dlopen()'ed in Unknown on line 0

In this case set the following Environment variables:
export INFORMIXDIR=/path/to/Informix/CSDK/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$INFORMIXDIR/lib:$INFORMIXDIR/lib/cli:$INFORMIXDIR/lib/esql

http://members.iiug.org/forums/oat/index.cgi/noframes/read/196
up
0
dbeecher at tekops dot com
9 years ago
Solved the issue with PHP 5.2.4 and others.

The embedded PDO in php since 5.1+ is INCOMPATIBLE with the latest PDO_MYSQL and PDO_INFORMIX, etc.  I just spent 2 days working on this.  This solution works on numerous versions of Linux I've tried as well as SunOS and HPUX.

The basic issue, getting this message when running PHP with PDO and trying
to get PDO_INFORMIX working, but having a version conflict:

"PHP Fatal error: PDO: driver informix requires PDO API version 20060409;
this is PDO version 20060511 in Unknown on line 0"

The "embedded" PDO that is within PHP since version 5.1 CONFLICTS with the
PDO the  PEAR/PECL modules are expecting.

1) Rebuild PHP with no pdo (--disable-pdo) (and you can't have
  any stuff like --with-mysql-pdo, either)
2) Then use PEAR/PECL to install PDO:  pear install pdo
3) then use PEAR/PECL to install PDO_INFORMIX:
              pear install --alldeps pdo_informix
4) make sure your php.ini extensions_dir points to the directory
   where these are placed
5) then add these references to php.ini:
    extensions=pdo.so
    extensions=pdo_informix.so
    extensions=pdo_mysql.so (etc.)

6) run php -v now and you should not see any errors.

7) run "pear list" and "pecl list" to see the installed modules

8) run php -i |egrep "pdo|PDO" to see:

php -i |egrep "pdo|PDO"
Configure Command =>  './configure'  '--disable-pdo'
'--with-apxs2=/usr/local/apache2/bin/apxs' '--with-openssl=/usr'
'--enable-force-cgi-redirect' '--with-gd' '--with-jpeg-dir=/usr/lib'
'--with-zlib' '--enable-bcmath' '--enable-mbstring=all' '--with-curl'
PDO
PDO support => enabled
PDO drivers => mysql, informix
pdo_informix
pdo_informix support => enabled
pdo_mysql
PDO Driver for MySQL, client library version => 5.0.51a

I would have tried the embedded PDO and then also --with-informix-pdo=shared but as an earlier post here showed, the --with-informix... is unknown.  Please correct my mistake if I am mistyping it.

GOOD LUCK!
David
up
-2
dan at mutagenix dot org
8 years ago
I've just built PHP 5.2.11 with pdo_informix support on Slackware 13.0.  I had to use the following options in order to disable pdo from being compiled in (notice the difference in the --without-pdo-sqlite option from previous post):

--disable-pdo option --without-pdo-sqlite option

I also could not use the --with-sigchild option which caused problems with phpize.

This fixed the informix -11001 error that I was getting.  I was also getting an informix -23101 error (something about locale mismatches), but it was because I was not completely removing the compiled in pdo support.

I then had to;

rm -rf /usr/lib/php/.channels
pear update-channels
pecl install --alldeps pdo_informix pdo_mysql pdo_sqlite.

There were other, smaller issues, but that is the lion's share.
up
-4
rdutan at aplext dot com
5 years ago
tip: in fedora 16 you must set INFORMIXDIR  in /etc/sysconfig/httpd
example:
INFORMIXDIR=/home/informix
export INFORMIXDIR
To Top