Click to See Complete Forum and Search --> : Apache + PHP + Oracle 8i installation
I'm trying to install php over apache to connect to an Oracle 8i database. This is the situation so far:
Oracle is installed and running correctly (I can connect, work with tables, etc) on the same machine as apache and php
Apache is configured with --enable-rule=SHARED_CODE --enable-module=so --prefix=/path/to/apache
At this point I start apache and can see my default page.
PHP configured with --with-apxs=/path/to/apxs
Restart apache, I can now see my default .php page
Reconfigure php with --with-apxs=/path/to/apxs --with-oci8=/$ORACLE_HOME (only I type the full path here)
Restart apache, I now get a connection refused error when trying to load either my default .html or .php pages. Httpd does not start. No error message, it just doesn't start.
There are no error messages generated during configure or install. This is driving me NUTS!
Any ideas?
Thanks,
Sheila
Been there, gone nuts myself for a while ....
Assuming you built everything OK, just go to your /apache_dir/bin and modify the apachectl script adding in the start/startssl section(s) something like:
# set up Oracle environment
if [ "x$ORACLE_HOME" = "x" ] ; then
export ORACLE_BASE=/home/oracle/ora8i/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/8.1.6
export PATH=$ORACLE_HOME/bin:$PATH
export LD_PRELOAD=$ORACLE_HOME/lib/libclntsh.so.8.0
fi
This is taken directly from an installation of mine on a Linux RedHat 6.2 (kernel 2.4.2) Web server, with PHP 4.0.4pl1 and Oracle8i v.8.1.6.1.0 installed in /home/oracle ... change ORACLE_BASE and ORACLE_HOME to suit your environment and it should work.
The problem lies in failing to preload libclntsh.so.8.0.
Hope this helps
Massimo
Also, make sure that the $ORACLE_SID is set in your system.
:-)
I forgot to mention that I only installed Oracle8i Client -> Programmer on the Web server, since the RDBMS resides on a dedicated machine, and I also explicitly select the DB alias from those defined in tnsnames.ora when calling OCIPLogon ... so that ORACLE_SID isn't really needed.
Nonetheless, Ranjith gives sound advice.
Massimo
Thanks for the tips. I've somehow managed to trash my original apache install to the point where it doesn't work at all now, php or no. So once I get that resolved again, I'll give this a try.
One other question: If I've got Oracle running on the same box as apache & php, do I still need to install the client on that box? I haven't, on the theory that the database itself has whatever libraries etc. are needed. Maybe I need to include that also.
Thanks,
Sheila
You should be all set, since what is normally advised is to install the whole Oracle8i software ... I wanted to save space and install just what I needed, so experimented on my own and it worked.
Bye,
Massimo
If Oralce Installation is typical or even compact.. nothing to worry.
Try locating tnsnames.ora and editing the tags.. set your host name among them if it is already not there.
set all env variables ( Linux/Unix..) and as I said the other day,make sure that ORACLE_SID is set.. this is important for php.
Take care..
Ranjith.
Hi, Sheila:
The following is the procedure that for sure works:
$./configure --prefix=/usr/local/apache \
--enable-rule=SHARED_CORE \
--enable-shared=rewrite \
$make install
**********
$./configure --with-apxs=/usr/local/apache/bin/apxs \
--with-mysql=/usr/local/mysql \
--with-oci8=$ORACLE_HOME \
$make install
You do not need to setup apache with the so option. The other thing you have to make sure that the listener is running. The php config will also setup mysql. If you do not want mysql setup just delete that line.
I hope this helps.....thankx --jh
PHP Builder
Copyright Internet.com Inc. All Rights Reserved.