紧急求救,关于php连接db2的操作

jxdyzwh 2012-09-23 02:39:50
各位好,公司有个项目要用php和DB2开发,程序已经写好了,在我本地上也能运行,现在部署到centos服务器上运行不了,提示db2_connect未定义,想请大家帮下忙,在CENTOS上如何配置PHP与odbc的按链接操作,十分感谢!我找了二天了,都没有任何进展,哭的心都有了,希望大家能帮下我
...全文
243 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
jxdyzwh 2012-09-27
  • 打赏
  • 举报
回复
楼上的,那个是警告错误
craboy1 2012-09-24
  • 打赏
  • 举报
回复
You will need re2c 0.9.11 or later if you want to regenerate PHP parsers
你用版本太低了。
用re2c或是You will need re2c 0.9.11 or later if you want to regenerate PHP parsers.搜一搜
jxdyzwh 2012-09-24
  • 打赏
  • 举报
回复
楼上的,已经试了您说的这种方法,提示啊了DB2 CLI之类的
jxdyzwh 2012-09-24
  • 打赏
  • 举报
回复
[root@gsidc-ywxt-wl03 DB2]# pecl install ibm_db2
downloading ibm_db2-1.9.3.tgz ...
Starting to download ibm_db2-1.9.3.tgz (156,494 bytes)
.................................done: 156,494 bytes
5 source files, building
running: phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20050922
Zend Extension Api No: 220051025
DB2 Installation Directory? : /path/to/DB2
building in /var/tmp/pear-build-root/ibm_db2-1.9.3
running: /tmp/tmplV9Ev0/ibm_db2-1.9.3/configure --with-IBM_DB2=/path/to/DB2
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking whether gcc and cc understand -c and -o together... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... i686-redhat-linux-gnu
checking host system type... i686-redhat-linux-gnu
checking target system type... i686-redhat-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext
checking for PHP extension directory... /usr/lib/php/modules
checking for PHP installed headers prefix... /usr/include/php
checking for re2c... no
configure: WARNING: You will need re2c 0.9.11 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking for IBM_DB2 support... yes, shared
checking Looking for DB2 CLI libraries... checking in /path/to/DB2...
checking in /path/to/DB2/lib64...
checking in /path/to/DB2/lib32...
checking in /path/to/DB2/lib...
not found
configure: error: Please reinstall the DB2 CLI distribution
ERROR: `/tmp/tmplV9Ev0/ibm_db2-1.9.3/configure --with-IBM_DB2=/path/to/DB2' failed
tottyandbaty 2012-09-24
  • 打赏
  • 举报
回复
貌似你的centos上要安装db2
gbyukg 2012-09-23
  • 打赏
  • 举报
回复
要是系统上已经安装好PHP 直接装db2扩展就可以了 可以自己下,也可以利用pecl直接安装(推荐)
pecl install ibm_db2
jxdyzwh 2012-09-23
  • 打赏
  • 举报
回复
因为那系统已经有其它的程序在运行,我想不影响其它程序的基础上加上其DB2的扩展
jxdyzwh 2012-09-23
  • 打赏
  • 举报
回复
楼上的,小弟是新手,不是很熟悉,那个CENTOS的PHP不是原来就自带了的吗,麻烦帮忙指点下
gbyukg 2012-09-23
  • 打赏
  • 举报
回复
db2_connect未定义 应该是你没装db2扩展吧?
http://www.cnblogs.com/gbyukg/archive/2011/10/09/2204916.html
这篇文章下面有安装db2扩展的说明(系统:centos db2版本>=975)

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧