pecl 安装 ibm_db2 失败
我需要安装 ibm_db2 扩展来使 php 与 db2 连接。所以我用了pecl。但它会产生错误。
$ pecl install ibm_db2
当我运行这个时,出现以下错误。
.....
checking in /home/db2inst1/sqllib/lib64...
checking in /home/db2inst1/sqllib/lib32... found
checking for DB2 CLI include files in default path... checking in /home/db2inst1/sqllib... not found
configure: error: Please reinstall the DB2 CLI distribution
ERROR: `/tmp/pear/temp/ibm_db2/configure --with-IBM_DB2=/home/db2inst1/sqllib' failed
请帮忙。
I need to install ibm_db2 extension for making php connection with db2. So I have used pecl. But it produces error.
$ pecl install ibm_db2
When I run this, the below error occurs.
.....
checking in /home/db2inst1/sqllib/lib64...
checking in /home/db2inst1/sqllib/lib32... found
checking for DB2 CLI include files in default path... checking in /home/db2inst1/sqllib... not found
configure: error: Please reinstall the DB2 CLI distribution
ERROR: `/tmp/pear/temp/ibm_db2/configure --with-IBM_DB2=/home/db2inst1/sqllib' failed
Please help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
ibm_data_server_driver_for_odbc_cli_linuxx64_v97.tar.gz
解压
到:/opt/ibm/
当提示输入 DB2 安装目录时,请使用:
/opt/ibm/odbc_cli/clidriver/
ibm_data_server_driver_for_odbc_cli_linuxx64_v97.tar.gz
from ibm.comuntar
the file into:/opt/ibm/
When prompted for DB2 Installation Directory, use:
/opt/ibm/odbc_cli/clidriver/
您需要 DB2 标头来构建 ibm_db2 PHP 扩展。它们包含在 IBM 数据服务器驱动程序中对于 ODBC 和 CLI。
You need the DB2 headers to build the ibm_db2 PHP extension. They are included in the IBM Data Server Driver for ODBC and CLI.
在安装 ibm_db2 之前,您已经安装了 expc,在解压的文件夹中使用 root 用户执行脚本 db2_install: # ./db2_install
它会询问安装路径 (e /opt/ibm/db2)
然后安装 ibm_db2
before install ibm_db2, you have install expc, in the folder uncompress execute the script db2_install with root user: # ./db2_install
It asks for the installation path (e /opt/ibm/db2)
then install ibm_db2
安装 DB2 实例(在 Ubuntu 上,由于以下说明:http://www.db2teamblog.com/2010/09/db2-express-c-packages-for-ubuntu-1004.html)这也适用于较新的系统。
之后运行以下命令:
出现提示时键入:
并确认安装目录
Install a DB2 instance (On Ubuntu due to following instructions: http://www.db2teamblog.com/2010/09/db2-express-c-packages-for-ubuntu-1004.html) This will work also on newer systems.
After that run the following command:
When prompted type:
and confirm the installation directory
该错误是因为在路径
/home/db2inst1/sqllib
中找不到 include 文件夹。您必须下载
db2exc_974_LNX_x86_64.tar.gz
,解压它(例如/otp/ibm/db2)
然后安装pecl install ibm_db2
DB2安装目录?使用这个:
/opt/ibm/db2
The error is because in the path
/home/db2inst1/sqllib
not found the include folder.you must download
db2exc_974_LNX_x86_64.tar.gz
, uncompress it(e. /otp/ibm/db2)
then install pecl install ibm_db2
DB2 Installation Directory? use this :
/opt/ibm/db2
另请查看 Jean Ferreira 对 PHP 手册的第一条评论。
链接
Check also the first comment on PHP manual by Jean Ferreira.
link
当您安装客户端时,您需要应用程序开发工具,您应该可以选择安装它们。
检查您的
/home/db2inst1/sqllib/include
文件夹,您会发现只有 asn.h,当您没有安装开发工具时,会丢失大量文件。然后使用
/home/db2inst1/sqllib
作为安装目录。You need the APPLICATION DEVELOPMENT TOOLS when you install the client you should have the option to install them.
Check your
/home/db2inst1/sqllib/include
folder you'll see that you only have asn.h, a boatload of files is missing when you don't have the development tools installed.Then use
/home/db2inst1/sqllib
as your install directory.我的 DB2 安装中缺少 APPLICATION_DEVELOPMENT_TOOLS(通过在包含文件夹中仅包含 asn.h 来确认)
要将 APPLICATION_DEVELOPMENT_TOOLS 安装到现有的 DB2 安装中,请按照以下说明进行操作
检查您的产品信息。您稍后将需要此信息。
db2ls -p -q -b /opt/ibm/db2/V10.5
从 IBM 下载适当的通用修订包:
https://www-945.ibm.com/support/fixcentral/swg/selectFixes?parent=ibm~Information%2BManagement&product=ibm/Information+Management/DB2&release=All&platform= Linux+64位,x86_64&function=textSearch&text=universal
/opt/ibm/fixpack
Gunzip/Tar 文件
cd /opt/ibm/fixpack
gunzip /opt/ibm/fixpack/downloaded_pack.tar.gz
tar xvf /top/ibm/fixpack/downloaded_pack.tar
像这样创建一个响应文件
/opt/ibm/fixpack/devtools.resp
。将 PROD 值替换为产品响应文件 ID
将 FILE 值替换为 DB2 安装文件夹
<代码>
产品 = DB2_SERVER_EDITION
文件 = /opt/ibm/db2/V10.5
LIC_协议=接受
安装类型 = 自定义
COMP = 应用程序开发工具
db2stop
或db2stop force
停止 DB2使用响应代码运行 db2setup
cd /opt/ibm/fixpack/universal/
./db2setup -r /opt/ibm/fixpack/devtools.resp
使用
dbstart
启动 DB2pecl install ibm_db2
使用
/home/db2inst1/sqllib
作为安装目录。Original instructions were found here to install them into an existing DB2 installation (I used the 3rd option):
http://db2commerce.com/2014/02/11/installing-a-db2-component-after-the-rest-of-db2-is-installed/
I lacked the APPLICATION_DEVELOPMENT_TOOLS in my DB2 installation (confirmed by only having asn.h in my includes folder)
To install the APPLICATION_DEVELOPMENT_TOOLS into an existing DB2 installation, follow these instructions
Check your product information. You will need this information later.
db2ls -p -q -b /opt/ibm/db2/V10.5
Download the appropriate Universal Fix Pack from IBM:
https://www-945.ibm.com/support/fixcentral/swg/selectFixes?parent=ibm~Information%2BManagement&product=ibm/Information+Management/DB2&release=All&platform=Linux+64-bit,x86_64&function=textSearch&text=universal
/opt/ibm/fixpack
Gunzip/Tar the file
cd /opt/ibm/fixpack
gunzip /opt/ibm/fixpack/downloaded_pack.tar.gz
tar xvf /top/ibm/fixpack/downloaded_pack.tar
Create a response file
/opt/ibm/fixpack/devtools.resp
like this.Replace the PROD value with the Product Response File ID
Replace the FILE value with the DB2 installation folder
PROD = DB2_SERVER_EDITION
FILE = /opt/ibm/db2/V10.5
LIC_AGREEMENT = ACCEPT
INSTALL_TYPE = CUSTOM
COMP = APPLICATION_DEVELOPMENT_TOOLS
db2stop
ordb2stop force
Run db2setup with the response code
cd /opt/ibm/fixpack/universal/
./db2setup -r /opt/ibm/fixpack/devtools.resp
Start DB2 with
dbstart
pecl install ibm_db2
Use
/home/db2inst1/sqllib
as your install directory.Original instructions were found here to install them into an existing DB2 installation (I used the 3rd option):
http://db2commerce.com/2014/02/11/installing-a-db2-component-after-the-rest-of-db2-is-installed/
我得到了上述问题的解决方案。
安装db2时需要选择Custom Install。所以我只是卸载并重新安装 DB2。
之后它对我来说效果很好。谢谢大家:)
I got solution for the above issue.
Need to select Custom Install while installing db2. So I just uninstalled and reinstalled DB2.
After that It works fine for me. Thanks everyone :)