pecl instal ibm_db2 fails

2019-07-05 05:23发布

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.

9条回答
爷的心禁止访问
2楼-- · 2019-07-05 05:36

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

查看更多
趁早两清
3楼-- · 2019-07-05 05:37

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

查看更多
淡お忘
4楼-- · 2019-07-05 05:41

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.

查看更多
我想做一个坏孩纸
5楼-- · 2019-07-05 05:49

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/

查看更多
相关推荐>>
6楼-- · 2019-07-05 05:59

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

查看更多
霸刀☆藐视天下
7楼-- · 2019-07-05 05:59

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

link

查看更多
登录 后发表回答