百科狗-知识改变命运!
--

Informix(PDO) - PDO驱动

百变鹏仔12个月前 (11-21)阅读数 19#技术干货
文章标签游标

Informix(PDO)

简介

PDO_INFORMIX是一个驱动程序,该驱动程序实现PHP数据对象(PDO)接口以允许从PHP访问Informix数据库

安装

Informix(PDO) - PDO驱动

要构建PDO_INFORMIX扩展,必须将Informix Client SDK 2.81 UC1或更高版本与PHP安装在同一系统上。可从»IBM Informix支持站点获得Informix Client SDK。

PDO_INFORMIX是»PECL扩展,因此请按照PECL扩展库安装中的说明安装PDO_INFORMIX扩展。发出configure命令以指向您的Informix Client SDK头文件和库的位置,如下所示:

 bash$ ./configure --with-pdo-informix=/path/to/SDK[,shared]
The configure command defaults to the value of theINFORMIXDIRenvironment variable.


Scrollable cursors

PDO_INFORMIX支持可滚动游标;但是,默认情况下未启用它们。要启用可滚动游标支持,必须ENABLESCROLLABLECURSORS=1在odbc.ini中设置相应的ODBC连接设置,或EnableScrollableCursors=1在DSN连接字符串中传递子句。

Table of Contents

  • PDO_INFORMIX DSN—连接到Informix数据库
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
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
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
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
Anyone gets working pdo informix with php 7 ?
tip: in fedora 16 you must set INFORMIXDIR in /etc/sysconfig/httpd
example:
INFORMIXDIR=/home/informix
export INFORMIXDIR
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.

鹏仔微信 15129739599 鹏仔QQ344225443 鹏仔前端 pjxi.com 共享博客 sharedbk.com

免责声明:我们致力于保护作者版权,注重分享,当前被刊用文章因无法核实真实出处,未能及时与作者取得联系,或有版权异议的,请联系管理员,我们会立即处理! 部分文章是来自自研大数据AI进行生成,内容摘自(百度百科,百度知道,头条百科,中国民法典,刑法,牛津词典,新华词典,汉语词典,国家院校,科普平台)等数据,内容仅供学习参考,不准确地方联系删除处理!邮箱:344225443@qq.com)

图片声明:本站部分配图来自网络。本站只作为美观性配图使用,无任何非法侵犯第三方意图,一切解释权归图片著作权方,本站不承担任何责任。如有恶意碰瓷者,必当奉陪到底严惩不贷!

内容声明:本文中引用的各种信息及资料(包括但不限于文字、数据、图表及超链接等)均来源于该信息及资料的相关主体(包括但不限于公司、媒体、协会等机构)的官方网站或公开发表的信息。部分内容参考包括:(百度百科,百度知道,头条百科,中国民法典,刑法,牛津词典,新华词典,汉语词典,国家院校,科普平台)等数据,内容仅供参考使用,不准确地方联系删除处理!本站为非盈利性质站点,本着为中国教育事业出一份力,发布内容不收取任何费用也不接任何广告!)