#native_company# #native_desc#
#native_cta#

Configuring PHP with ORACLE 8i Support

By Ismail YENIGUL
on January 22, 2002

In this article, I will briefly describe how to compile PHP with ORACLE
8i support.
When I tried to compile php with oracle support
on Solaris 2.6, I received lots of problems.
After tedious search on the internet, I have
found a solution. I have following configuration:
  • ORACLE 8.1.6
  • PHP 4.0.6
  • Apache 1.3.19 (Already Installed)
Firstly unpack php as root:
 #tar zxvf php-4.0.6.tar.gz
 #cd php-4.0.6
Because apache is already
installed, I want PHP to run as a dynamic Apache module.
I ran the configure script as follows:
  ./configure --with-apxs=/www/bin/apxs --enable-track-vars 
              --with-oci8=/u01/app/oracle/product/8.1.6 
              --with-oracle=/u01/app/oracle/product/8.1.6
This tells the configure script to build PHP as
a shared Apache module and support for ORACLE. If your apxs path is
different then /www/bin/apxs, replace /www/bin/apxs with your apxs
path. Also /u01/app/oracle/product/8.1.6 is my $ORACLE_HOME path. If
your $ORACLE_PATH is different replace /u01/app/oracle/product/8.1.6 with
your $ORACLE_HOME path.
The first time I ran the configure script it
has given following error:
 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!
After adding –enable-sigchild
parameter:
 ./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
And then it gives this error:
 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!
After searching on the internet, I found that
there is a bug in php-4.0.6/configure file.
I’ve to clarify here that this bug is not due to the php package but ONLY
due to Oracle changes after version 8.1.5.
Oracle decided to change the
“orainst” directory name since version 8.1.5 to “install” in
the $ORACLE_HOME directory. Therefore the script cannot open the file called
“unix.rgs” there! The configure script can not find oracle version
so it always returns 7.3 as ORACLE_VERSION.