Forum Moderators: coopster

Message Too Old, No Replies

Compiling php with oracle support

         

fintan

10:52 am on Sep 4, 2003 (gmt 0)

10+ Year Member



Hi I'm looking for some help with compiling php with oracle support on RH7.1/RH9. I've looked at php's site
"http://www.php.net/manual/en/ref.oci8.php" and it says I need to set up some environment variables like ORACLE_HOME & LD_PRELOAD. I know what ORACLE_HOME is but I haven't got a clue about the rest of them. Any ideas? Thanks

fintan.

jatar_k

4:21 pm on Sep 7, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



To be honest I can't quite remember. We use php/oracle at work and I am not there right now. I will have a look tomorrow and see if there are any other differences.

daisho

4:27 pm on Sep 7, 2003 (gmt 0)

10+ Year Member



You must have the Oracle Client installed. When you install the oracle client you will set a pile of environment variables in /etc/profile.

These *MUST* be set when you start apache (and theirfore PHP) in order for OCI to work.

You can get the OCI8 Libs from oracle dot com.

daisho

jatar_k

4:28 pm on Sep 7, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I was hoping you would be wandering around daisho ;)

daisho

4:47 pm on Sep 7, 2003 (gmt 0)

10+ Year Member



Ya I haven't had a lot of time to post. New job and a couple new side projects have kept me way to busy :)

I plan to try to be around more now.

daisho.

fintan

10:58 am on Sep 8, 2003 (gmt 0)

10+ Year Member



Do you download them, cause I went lookin but couldn't find them. I thought they would come with the client. As for the variables this is what I got.

export LD_ASSUME_KERNEL=2.4.1

echo $LD_ASSUME_KERNEL
echo

export HOME=/home/oraclient/OraHome

echo $HOME
echo

export ORACLE_HOME=$HOME

echo $ORACLE_HOME
echo

export ORACLE_SID=opwapps

echo $ORACLE_SID
echo

export LD_PRELOAD=$ORACLE_HOME/lib/libclntsh.so

echo $LD_PRELOAD
echo

export LD_LIBRARY_PATH=$ORACLE_HOME/lib

echo $LD_LIBRARY_PATH
echo

#export NSL_LANG=en_IE.UTF-8

#echo $NSL_LANG
#echo

export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data

echo $ORA_NLS33
echo

I'm not sure if all of them are right. Like the $NSL_LANG. Not sure what to put there. For the compile I'm using

./configure --with-oracle=$ORACLE_HOME --with-oci8=$ORACLE_HOME --enable-so --with-apxs2=/usr/local/apache/bin/apxs --enable-sigchild --without-mysql

daisho

12:39 pm on Sep 8, 2003 (gmt 0)

10+ Year Member



Do you get any errors with the configure --with-oci8? If not sounds like your find and already have OCI on your system. If you get errors then you have to get the client.

If memory serves me they don't have the linux client seperate. You have to download the entire Oracle Server package but when you run it you can just install the client.

daisho

fintan

2:03 pm on Sep 8, 2003 (gmt 0)

10+ Year Member



I have the complete set of installation cd's. Do the libraries come with them or are they something different.

I keep on getting

checking Oracle version... configure: error: Oracle-OCI8 needed libraries not found.

Am I missing something, if all I'd need is the client it should just pick up the libraries.

daisho

2:27 pm on Sep 8, 2003 (gmt 0)

10+ Year Member



Run the install CD's and when you get the treeview to select the options the "Oracle Call Interface" is one of the options. Make sure it's checked and away you go.

daisho

fintan

1:57 pm on Sep 9, 2003 (gmt 0)

10+ Year Member



I went through the install again and picked custom install. Its in there "Oracle Call Interface" I don't think it installed by default. I'll install it and see if I can compile php then. Thanks

daisho

1:59 pm on Sep 9, 2003 (gmt 0)

10+ Year Member



That should get you going. The OCI is seperate from the Client.

daisho.

fintan

2:24 pm on Sep 18, 2003 (gmt 0)

10+ Year Member



I'm having a problem conecting to the oracle database with the client "linux". Which is also effecting the php connection script. I guess this is more of an oracle question than anything else.

I'm using

$conn = ora_logon("pswd@testdb", "usrname")

and I get

Warning: Oracle: Connection Failed: Error while trying to retrieve text for error ORA-01019 in /home/ftpuser/web/conn.string.php on line 14

also using

$db_conn = ocilogon( $usr, $pswd, $db );

I get

Warning: ocilogon(): _oci_open_server: Error while trying to retrieve text for error ORA-12154 in /home/ftpuser/web/conn.string.php on line 16

I can connect using the commmand "sqlplus usrname/pswd@testdb"
but I can't with only "sqlplus". I've been messing around with it with no joy. Any ideas?

daisho

2:35 pm on Sep 18, 2003 (gmt 0)

10+ Year Member



The oracle database does not exist on the linux server right? The first thing is to get the oracle error message file onto the linux server so that you will get meaningfull messages rather than "Cannot Get Text". But a search at technet.oracle.com for that ORA error number will give you some good clues to the reason for the error and possible solutions.

Don't use the ora_ functions and I'd suggest to take them out of PHP unless you need to use OCI7 the old OCI. Use the OCI functions which are the current OCI implementations.

daisho.

fintan

3:06 pm on Sep 18, 2003 (gmt 0)

10+ Year Member



It's there alright. There are around five databases on the server. I can connect with a windows client but not the linux client. I'm using RH9 Pro. Could be a problem with it. I've had a look at technet.oracle.com with no real joy. I've got an idea but no real definates. I'll have a look into the new OCI functions. Thanks.