Andy, Thanks for the follow up so quickly. We are using the same
oracle home for the php. in the phpinfo page php is setup for oracle
home in the right place as well on the oci8 display. The output of
your suggestions were as follows:
The output of the first was discouraging:
ORACLE HOME:
LD_LIBRARY_PATH: . :/lib
PATH: /usr/sbin:/bin:/usr/bin:/sbin:/usr/X11R6/bin
Nothing returned for oracle home.
The output from the shell was correct for all.
I have these lines of code in the httpd.conf file just under the
AddModule Section:
SetEnv ORACLE_HOME /opt/oracle/OraHome1
SetEnv LD_LIBRARY_PATH /opt/oracle/OraHome1/lib
SetEnv TNS_ADMIN /opt/oracle/OraHome1/tnsnames.ora
SetEnv TWO_TASK /opt/oracle/OraHome1/tnsnames.ora
SetEnv NLS_LANG English_America.WE8ISO8859P1
SetEnv ORACLE_BASE /opt/oracle/OraHome1
Any suggestions?
Thanks for your help
Andy Hassall <an**@andyh.co.uk> wrote in message news:<75********************************@4ax.com>. ..
On 7 Jan 2004 16:08:06 -0800, cs*****@overstock.com (Chad The Man) wrote:
I have been developing some applications on suse 9 / apache 1.37 / php
4.3.4 / Oracle 9i / OCI8. We recently moved servers, apache works
fine, php works fine, oracle works fine... however, trying to connect
to oracle from php it dies with the following error :
Warning: ocilogon(): _oci_open_session: OCIHandleAlloc
OCI_HTYPE_SVCCTX: OCI_INVALID_HANDLE
Using SQL plus I can connect just fine.
So the Oracle install is (probably) OK (assuming you're using the same Oracle
home that you're trying to use with PHP).
The variables are all set in apache
Are you _sure_? Could you post the output of:
<pre>
<?php
echo $_ENV['ORACLE_HOME'] . "\n";
echo $_ENV['LD_LIBRARY_PATH'] . "\n";
echo $_ENV['PATH'] . "\n";
?>
</pre>
and the connection string...
Doesn't look it's got far enough for that to matter yet.
the permissions on the oracle folder are all correct.
Are you _sure_? Post the output of (from a shell):
ls -ld $ORACLE_HOME
ls -ld $ORACLE_HOME/bin
ls -ld $ORACLE_HOME/lib*
The error you've posted usually comes from:
(a) Environment variables not set or wrong.
(b) ORACLE_HOME set to a different home to the one that PHP was compiled
against, e.g. mixing up 8i and 9i.
(c) ORACLE_HOME not accessible by webserver - 9i default permissions are
stricter than 8i.