pecl 安装 ibm_db2 失败

发布于 2024-11-16 18:00:33 字数 524 浏览 8 评论 0原文

我需要安装 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

爱冒险 2024-11-23 18:00:33
  1. 从 ibm.com 下载 ibm_data_server_driver_for_odbc_cli_linuxx64_v97.tar.gz
  2. 将文件解压 到:/opt/ibm/
  3. 输入命令 > pecl 安装 ibm_db2

    当提示输入 DB2 安装目录时,请使用:/opt/ibm/odbc_cli/clidriver/

  1. download ibm_data_server_driver_for_odbc_cli_linuxx64_v97.tar.gz from ibm.com
  2. untar the file into: /opt/ibm/
  3. enter command > pecl install ibm_db2

    When prompted for DB2 Installation Directory, use: /opt/ibm/odbc_cli/clidriver/

↘紸啶 2024-11-23 18:00:33

您需要 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.

桃扇骨 2024-11-23 18:00:33

在安装 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

绅士风度i 2024-11-23 18:00:33

安装 DB2 实例(在 Ubuntu 上,由于以下说明:http://www.db2teamblog.com/2010/09/db2-express-c-packages-for-ubuntu-1004.html)这也适用于较新的系统。

之后运行以下命令:

pecl install ibm_db2

出现提示时键入:

/opt/ibm/dbs/V9.7/

并确认安装目录

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:

pecl install ibm_db2

When prompted type:

/opt/ibm/dbs/V9.7/

and confirm the installation directory

不知所踪 2024-11-23 18:00:33

该错误是因为在路径 /home/db2inst1/sqllib 中找不到 include 文件夹。

您必须下载db2e​​xc_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

蓝颜夕 2024-11-23 18:00:33

另请查看 Jean Ferreira 对 PHP 手册的第一条评论。

链接

Check also the first comment on PHP manual by Jean Ferreira.

link

許願樹丅啲祈禱 2024-11-23 18:00:33

当您安装客户端时,您需要应用程序开发工具,您应该可以选择安装它们。

检查您的 /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.

度的依靠╰つ 2024-11-23 18:00:33

我的 DB2 安装中缺少 APPLICATION_DEVELOPMENT_TOOLS(通过在包含文件夹中仅包含 asn.h 来确认)

要将 APPLICATION_DEVELOPMENT_TOOLS 安装到现有的 DB2 安装中,请按照以下说明进行操作

  1. 检查您的产品信息。您稍后将需要此信息。
    db2ls -p -q -b /opt/ibm/db2/V10.5

  2. 从 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

    • 请务必找到匹配的 FixPack 版本(来自上述步骤)和正确的架构。
    • 将文件保存到 /opt/ibm/fixpack
  3. Gunzip/Tar 文件
    cd /opt/ibm/fixpack
    gunzip /opt/ibm/fixpack/downloaded_pa​​ck.tar.gz
    tar xvf /top/ibm/fixpack/downloaded_pa​​ck.tar

  4. 像这样创建一个响应文件 /opt/ibm/fixpack/devtools.resp
    将 PROD 值替换为产品响应文件 ID
    将 FILE 值替换为 DB2 安装文件夹
    <代码>
    产品 = DB2_SERVER_EDITION
    文件 = /opt/ibm/db2/V10.5
    LIC_协议=接受
    安装类型 = 自定义
    COMP = 应用程序开发工具

  5. 使用 db2stopdb2stop force 停止 DB2
  6. 使用响应代码运行 db2setup
    cd /opt/ibm/fixpack/universal/
    ./db2setup -r /opt/ibm/fixpack/devtools.resp

  7. 使用 dbstart 启动 DB2

  8. 完成后,运行
    pecl 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

  1. Check your product information. You will need this information later.
    db2ls -p -q -b /opt/ibm/db2/V10.5

  2. 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

    • Be sure to find the matching FixPack version (from the step above) and the correct architecture.
    • Save the file to /opt/ibm/fixpack
  3. Gunzip/Tar the file
    cd /opt/ibm/fixpack
    gunzip /opt/ibm/fixpack/downloaded_pack.tar.gz
    tar xvf /top/ibm/fixpack/downloaded_pack.tar

  4. 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

  5. Stop DB2 with db2stop or db2stop force
  6. Run db2setup with the response code
    cd /opt/ibm/fixpack/universal/
    ./db2setup -r /opt/ibm/fixpack/devtools.resp

  7. Start DB2 with dbstart

  8. When you are done, run
    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/

鹿港小镇 2024-11-23 18:00:33

我得到了上述问题的解决方案。

安装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 :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文