Reputation: 133
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.
Upvotes: 3
Views: 7358
Reputation: 61
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
or db2stop 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
/home/db2inst1/sqllib
as your install directory.Upvotes: 0
Reputation: 1228
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.
Upvotes: 0
Reputation: 61
ibm_data_server_driver_for_odbc_cli_linuxx64_v97.tar.gz
from ibm.comuntar
the file into: /opt/ibm/
/opt/ibm/odbc_cli/clidriver/
Upvotes: 6
Reputation: 237
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
Upvotes: 1
Reputation: 11
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
Upvotes: 0
Reputation: 11
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
Upvotes: 1
Reputation: 133
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 :)
Upvotes: -1
Reputation: 1514
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.
Upvotes: 2