PHP ye ORACLE 8i destegi
Ismail YENIGUL <[email protected]>

Bu dokumanda kisaca php yi  oracle destegi ile nasil derlenecegini anlatacagim.

Bu dokumani yazmanin sebebi; php ye  oracle 8i   destegi vermem gereken bir solaris 2.6 makina vardi ve php yi oracle ile derlemek icin bayagi ugrasmak zorunda kaldim. Sonuca internet te uzun suren aramalardan sonra varabildim.

Konfigurasyon olarak 

* ORACLE 8.1.6
* PHP 4.0.6
* Apache 1.3.19(Daha onceden kurulu)

Kuracagim sistemde daha onceden apache kurulu idi o yuzden php ye oracle destegi vermek icin asagidaki parametreleri kullandim.

./configure --with-oci8=/u01/app/oracle/product/8.1.6 --with-apxs=/www/bin/apxs --enable-track-vars  --with-oracle=/u01/app/oracle/product/8.1.6 

apache onceden kurulu idi ve apxs programi /www/bin/apxs  de idi,  buradaki   /u01/app/oracle/product/8.1.6 ise benim oracle lin kurulu oldugu $ORACLE_HOME dizinidir siz kendi $ORACLE_HOME adresine gore degistiriniz.

sonuc olarak asagidaki hatayi aldim.

checking for Oracle-OCI8 support... yes
checking Oracle Install-Dir... /u01/app/oracle/product/8.1.6/
+--------------------------------------------------------------------+
| Notice: |
| If you encounter <defunc> processes when using a local Oracle-DB |
| please recompile PHP and specify --enable-sigchild when configuring|
| (This problem has been reported un Linux using Oracle >= 8.1.5) |
+--------------------------------------------------------------------+
checking Oracle version... 7.3
configure: error: Unsupported Oracle version!

daha sonra  --enable-sigchild parametresini ekledim.

./configure --with-oci8=/u01/app/oracle/product/8.1.6 --with-apxs=/www/bin/apxs --enable-track-vars  --with-oracle=/u01/app/oracle/product/8.1.6  --enable-sigchild

 

checking for Oracle-OCI8 support... yes
checking Oracle Install-Dir... /u01/app/oracle/product/8.1.6/
checking Oracle version... 7.3
configure: error: Unsupported Oracle version!

bu seferde yukaridaki hatayi aldim. 

arastirmalarim sonucu sorunun php-4.0.6.tar.gz ile gelen configure dosyasinda oldugunu ogrendim. aslinda php nin sorunu degil. biraz oracle in sorunu  cunku oracle firmasi oracle 8.1.5 den sonra versiyon bilgilerinin   oldugu $ORACLE_HOME/orainst/unix.rgs  dosyasinda degisiklik yapmistir. php de bu dosyaya bakarak oracle versiyonunu ogreniyordu. bu dosyadanda gerekli bilgileri alamadigi icin   configure: error: Unsupported Oracle version! hatasini veriyor.

COZUM:

  php-4.0.6/configure in  34050 -34068 satirlari arasina # koyarak bu satirlari iptal edin. ve 34070. satira ORACLE_VERSION=8.1 yazin

#echo $ac_n "checking Oracle version""... $ac_c" 1>&6 (34050. satir)
#echo "configure:34052: checking Oracle version" >&5
#if test -s "$ORACLE_DIR/orainst/unix.rgs"; then
#ORACLE_VERSION=`grep '"ocommon"' $ORACLE_DIR/orainst/unix.rgs | sed 's/ */:/g' | cut -d: -f 6 | cut -c 2-4`
#test -z "$ORACLE_VERSION" && ORACLE_VERSION=7.3
#elif test -f $ORACLE_DIR/lib/libclntsh.s?.8.0; then
#ORACLE_VERSION=8.1
#elif test -f $ORACLE_DIR/lib/libclntsh.s?.1.0; then
#ORACLE_VERSION=8.0
#elif test -f $ORACLE_DIR/lib/libclntsh.a; then
#if test -f $ORACLE_DIR/lib/libcore4.a; then
#ORACLE_VERSION=8.0
#else
#ORACLE_VERSION=8.1
#fi
#else
#{ echo "configure: error: Oracle needed libraries not found" 1>&2; exit 1; }
#fi
 #echo "$ac_t""$ORACLE_VERSION" 1>&6 (34068. satir)

 ORACLE_VERSION=8.1 #(34070. satir)

ayni sekilde  31537 ve  31555 satirlari arasina # koyun ve 31556 satira OCI8_VERSION=8.1  ifadesini yazin.

31537 echo $ac_n "checking Oracle version""... $ac_c" 1>&6
31538 echo "configure:31539: checking Oracle version" >&5
31539 if test -s "$OCI8_DIR/orainst/unix.rgs"; then
31540 OCI8_VERSION=`grep '"ocommon"' $OCI8_DIR/orainst/unix.rgs | sed 's/ */:/g' | cut -d: -f 6 | cut -c 2-4`
31541 test -z "$OCI8_VERSION" && OCI8_VERSION=7.3
31542 elif test -f $OCI8_DIR/lib/libclntsh.s?.8.0; then
31543 OCI8_VERSION=8.1
31544 elif test -f $OCI8_DIR/lib/libclntsh.s?.1.0; then
31545 OCI8_VERSION=8.0
31546 elif test -f $OCI8_DIR/lib/libclntsh.a; then
31547 if test -f $OCI8_DIR/lib/libcore4.a; then
31548 OCI8_VERSION=8.0
31549 else
31550 OCI8_VERSION=8.1
31551 fi
31552 else
31553 { echo "configure: error: Oracle-OCI8 needed libraries not found" 1>&2; exit 1; }
31554 fi
31555 echo "$ac_t""$OCI8_VERSION" 1>&6

OCI8_VERSION=8.1 #(3156. satir)

 

#make clean 
#./configure --with-oci8=/u01/app/oracle/product/8.1.6 --with-apxs=/www/bin/apxs --enable-track-vars        --with-oracle=/u01/app/oracle/product/8.1.6  --enable-sigchild
#make
#make install

komutlari ile php yi oracle destegini vermis olursunuz.
daha sonra httpd.conf a  

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

ifadelerini ekleyin. apache yi restart etmeden once

#export $LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/u01/app/oracle/product/8.1.6/lib

komutunu vererek oracle in $ORACLE_HOME/lib dizinide LD_LIBRARY_PATH e ekleyin ($ORACLE_HOME parametresini sizin oracle home dizini ile degistirin. ornegin: /u01/app/oracle/product/8.1.6/lib)
aksi takdirde apache yi restart yaptiginizda oracle lib leri bulamadigi icin hata mesaji alacaksiniz.
su andan itibaren php yi oracle destegi ile kullanabilirsiniz.

Ismail YENIGUL <[email protected]>

EnderUNIX Software Development Team Uyesi