[ Enlarge Image ]  
 
 
<< Back 
Posted: 2005/07/22 by: fcruz. Oracle DB Blogs.
So, you followed all the steps to compile apache , php and oracle 10g but still PHP is not talking to Oracle ? What a drag right ? Here you will find a possible solution that actually found me in the middle of lots of frustration, I hope this article works as a good release (Ive been there boys)

Locate a file called oraenv which is installed or added by the oracle installation, you will usually find this file in /usr/local/bin/oraenv

What we need to do is copy that file into /usr/local/apache/conf like this: cp /usr/local/bin/oraenv /usr/local/apache/conf/

Now that we have that file on the right location , we need to edit the apachectl (apache control file) file to call the oraenv file before executing the rest of stuff.

vi /usr/local/apache/bin/apachectl

Right below the lines that say starting configuration here ... add the lines like in the example below:

# |||||||||||||||||||| START CONFIGURATION SECTION ||||||||||||||||||||
# -------------------- --------------------
#
# Added by Felipe for Oracle environment
if [ -f /usr/local/apache/conf/oraenv ] ;
then
. /usr/local/apache/conf/oraenv
fi

Save the changes.

Now next time you start apache using apachectl , apachectl will ask 2 questions , will ask for the SID of your database , like for example ORCL ,
and will ask for the $ORACLE_HOME which usually is /u01/app/oracle/product/10.1.0/Db_1

Be sure to have set properly the oracle environment also in the root .bash_profile file like this: (example)

export USERNAME BASH_ENV PATH
export ORACLE_BASE=/u01/app/oracle
export ORACLE_SID=orcl
export ORACLE_HOME=/u01/app/oracle/product/10.1.0/Db_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib

This is extremely usefull info guys and gals , beleive me.

Felipe Cruz Ferrero @ 2005






[ Back ]