Hello friends,
I'm unable to connect to a remote oracle database using the oci8 calls in
php. When I run the following program oracle.php,
<?
OCIInternalDebug(1);
$oracon = OCILogon("xxx","yyy","zzz");
$lastupdate = OCIParse($oracon,"select tim from last_update");
$lastupdate = OCIExecute($lastupdate);
$lastupdate = OCIFetch($lastupdate);
OCILogoff($oracon);
echo $lastupdate;
?>
I get the following errors:
Warning: _oci_open_server: Error while trying to retrieve text for error
ORA-12154 in /var/www/html/oracle.php on line 3
OCIDebug: _oci_open_server: FAILURE -> CLEANUP called
OCIDebug: START _oci_close_server: detaching conn=0 dbname=his
OCIDebug: _oci_close_server: closing DEAD server
OCIDebug: oci_do_connect: FAILURE -> CLEANUP called
OCIDebug: START _oci_conn_list_dtor: id=0
OCIDebug: END _oci_conn_list_dtor: id=0
Warning: Supplied argument is not a valid OCI8-Connection resource
in /var/www/html/oracle.php on line 4
Warning: Supplied argument is not a valid OCI8-Statement resource in
/var/www/html/oracle.php on line 5
Warning: Supplied argument is not a valid OCI8-Statement resource in
/var/www/html/oracle.php on line 6
OCIDebug: START php_rshutdown_oci
OCIDebug: END php_rshutdown_oci
I'm able to execute the same query and get a result using the SQLPlus
client that's installed on the same linux box.... so, it's not an access
problem, it seems.
I compiled php 4.1.1 from souce (since the redhat 7.2 php rpm doesn't have
oracle support enabled), after setting ORACLE_HOME, ORACLE_SID and
LD_LIBRARY_PATH, with the following options:
configure command: ./configure --with-apxs=/usr/sbin/apxs --with-oci8
It compiled clean with no errors or warnings.
After installation, phpinfo() gave me the following information:
OCI8 Support enabled
Revision $Revision: 1.149.2.2 $
Oracle Version 8.1
Compile-time ORACLE_HOME /home/oracle/OraHome1
Apache environment:
LD_LIBRARY_PATH /home/oracle/OraHome1/lib
ORACLE_HOME /home/oracle/OraHome1
ORACLE_SID his
php variables:
_SERVER["LD_LIBRARY_PATH"] /home/oracle/OraHome1/lib
_SERVER["ORACLE_HOME"] /home/oracle/OraHome1
_SERVER["ORACLE_SID"] his
Can someone help me figure out where I might have gone wrong? I know it's a
long mail I've written, but I would appreciate anyone who takes the time to
go through it and offer any help.
Regards,
Vinu.
_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help