Compiling PHP 5 supports Oracle (k) ubuntu
by arkatPDA on Aug.08, 2006, under Uncategorized
This is an explanation of how to compile php 5, Ubuntu 6.06, in order to connect to Oracle database
I guess we have installed apache2 but it ran well on a console
$ sudo apt-get install apache2
We add to our list of repositories repository oracle, edit the file / etc / apt / sources.list and add the following line
deb http://oss.oracle.com/debian unstable main non-free
Then install the Oracle XE client.
$ sudo apt-get install oracle-xe-client
We set the variable $ ORACLE_HOME
$ export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/
We position ourselves in the / usr / src
$ cd /usr/src
We obtain the source code for PHP 5
$ sudo apt-get source php5
Install the Flex parser
$ sudo apt-get install flex
and development package apache2 that we need in the process of compilation.
$ sudo apt-get install apache2-dev
we position ourselves within the directory containing the source code of php 5 we went down (currently version 5.1.2).
$ cd /usr/src/php5-5.1.2/
Devido that when trying to compile with gcc 4 tube problems we chose to install add gcc 3.4
$ apt-get install gcc-3.4
replace the symbolic link from / usr / bin / gcc
$ sudo rm /usr/bin/gcc
Create a new symbolic link to the version of gcc we need.
$ sudo ln -s /usr/bin/gcc-3.4 /usr/bin/gcc
It is time to run the configure script.
$sudo ./configure --with-oci8=$ORACLE_HOME --with-apxs2=/usr/bin/apxs2
lugo compile and install.
make & make install
Next we have to do is configure the apache to process php.
edit the file / etc/apache2/apache2.conf and uncomment the following lines (by removing the # from the start)
# AddType application / x-httpd-php. Php
# AddType application / x-httpd-php-source. Phps
Then just restart the apache is
$ sudo /etc/init.d/apache2 restart
With this we have compiled our php to connect to an oracle database.

























