[PHP] Re: php + db2

2007-05-11 Thread johan.boye
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I saw this problem on the http mail archive, I hope it will help : 
 
Howto install Oracle and/or IBM db2 support for PHP 4 ou 5 or both on the 
cleanest way
 
 

1.1. Installation Oracle module for PHP 4  5


 


1.1.1.   Download from


http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html

 

è  Instant Client Package - Basic   
(instantclient-basic-linux32-10.2.0.2-20060331.zip)

è  Instant Client Package - SDK   
(instantclient-sdk-linux32-10.2.0.2-20060331.zip)

è  Instant Client Package - SQL*Plus   
(instantclient-sqlplus-linux32-10.2.0.2-20060331.zip)

 

Run this :

mkdir -p /opt/oracle/instantclient


cd /opt/oracle/instantclient


unzip instantclient-basic-linux32-10.2.0.1-20050713.zip

unzip instantclient-sdk-linux32-10.2.0.1-20050713.zip 

unzip instantclient-sqlplus-linux32-10.2.0.2-20060331.zip


echo /opt/oracle/instantclient  /etc/ld.so.conf

ldconfig

 

 

Create some missing symlinks  libclntsh.so et libocci.so :

cd /opt/oracle/instantclient/ 

ln -s libclntsh.so.10.1 libclntsh.so 

ln -s libocci.so.10.1 libocci.so

 

Environnement vars : (check out the PATH according to your install)

cat /etc/environment

 

ORACLE_HOME=/opt/oracle/instantclient

ORA_NLS33=/opt/oracle/instantclient/ocommon/nls/admin/data

TNS_ADMIN=/opt/oracle/instantclient/network/admin

NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P15

TNS_ADMIN=/opt/oracle/instantclient

 




Apache side : /etc/apache2/envvars 

ORACLE_HOME=/opt/oracle/instantclient

ORA_NLS33=/opt/oracle/instantclient/ocommon/nls/admin/data

TNS_ADMIN=/opt/oracle/instantclient/network/admin

NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P15

 

 

export TNS_ADMIN

export NLS_LANG

export ORACLE_HOME

export ORA_NLS33


1.1.2.   PHP oci8 et uncompress it : 


http://pecl.php.net/package/oci8

 

è  oci8-1.2.1.tgz (http://pecl.php.net/get/oci8-1.2.1.tgz)


1.1.3.   Compilation for PHP4 with the Instant client for the example


phpize4 ; ./configure  --with-php-config=/usr/bin/php-config4 
--with-oci8=shared,instantclient,/opt/oracle/instantclient ; make clean ; make 
; make install

 


1.1.4.   Compilation for PHP5 with the heavy full Oracle client for 
exemple


phpize5 ; ./configure --with-php-config=/usr/bin/php-config5 
--with-oci8=shared,$ORACLE_HOME; make clean ; make ; make install

 

 


1.1.5.   Edit /etc/phpX/apacheX/php.ini for the Oracle support 


# Support oracle

extension=oci8.so

 
 
 
 


1.2. Installation IBM DB2 modules for PHP 4  5


 


1.2.1.   Installation IBM DB2 client 


tar zxvf db2exc_LNX_26x86.tar.gz

 

 

Installation of Alien

apt-get install alien

 

Edit of the file : db2/linux/db2_install

 

Original :

( rpm -ivh  ${INSTDEV?}/${pkg?}${RPMEXTN?} 21; echo $?  ${TMPRC?} ) | tee -a 
${DB2INSTLOG?}

 

Modified:

( alien -dic  ${INSTDEV?}/${pkg?}${RPMEXTN?} 21; echo $?  ${TMPRC?} ) | tee 
-a ${DB2INSTLOG?}

 

 

then run ./db2_install

 

Specify one or more of the following keywords, 

separated by spaces, to install DB2 products.

 

 KeywordProduct Description

 DB2.EXPDB2 UDB Express Edition for LINUX

 

Enter help to redisplay product names.

 

Enter quit to exit.

 

***

DB2.EXP

 

1.1.1.   Module PHP for IBM db2


http://pecl.php.net/get/ibm_db2-1.2.3.tgz

 

 

Uncompress and run this for PHP4:

phpize4 ; ./configure --with-php-config=/usr/bin/php-config4 ; make clean ; 
make ; make install

 

Uncompress and run this for PHP5:

phpize5 ; ./configure --with-php-config=/usr/bin/php-config5 ; make clean ; 
make  ; make install

 


1.1.2.   Edit /etc/phpX/apacheX/php.ini for the IBM DB2 


# Support IBM DB2

extension=ibm_db2.so

 
 
 
After, you will have to configure DB2 to connect at the DB, i wonder how to do 
that :-/
 
 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)

iD8DBQFGRDrQQm4MlxivyKgRAoErAJ9dkTEHNh/Ko9BtL0tmn6VVsv58PwCgh7cY
iVJ4uGKEfiiV6Fd4SFRnmQQ=
=pbyf
-END PGP SIGNATURE-

Les informations contenues dans ce message électronique peuvent être de nature 
confidentielles et soumises à une obligation de secret. Elles sont destinées à 
l'usage exclusif du réel destinataire. Si vous n'êtes pas le réel destinataire, 
ou si vous recevez ce message par erreur, merci de le détruire immédiatement et 
de le notifier à son émetteur.

 The information contained in this e-mail may be privileged and confidential. 
It is intended for the exclusive use of the designated recipients named above. 
If you are not the intended recipient or if you receive this e-mail in error, 
please delete it and immediately notify the sender.



PGPexch.htm.asc
Description: PGP signature
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: php + db2

2007-04-26 Thread Man-wai Chang

build test failed. Please check the config.log for details.
You need to source your DB2 environment before running PHP configure:
# . $IBM_DB2/db2profile


so where is your db2profile?

--
  .~.   Might. Courage. Vision. Sincerity. http://www.linux-sxs.org
 / v \  Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Fedora Core 4)  Linux 2.6.17-1.2142_FC4
  ^ ^   17:56:01 up 84 days 1:40 1 user load average: 0.00 0.00 0.00

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: php + db2

2007-04-26 Thread Man-wai Chang
Man-wai Chang wrote:
 build test failed. Please check the config.log for details.
 You need to source your DB2 environment before running PHP configure:
 # . $IBM_DB2/db2profile
 
 so where is your db2profile?
 

did you `export IBM_DB2=x`?

-- 
  .~.   Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org
 / v \  Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Ubuntu 6.10)  Linux 2.6.20.7
  ^ ^   19:48:02 up 7 days 34 min 1 user load average: 3.57 3.86 3.34
news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php