Hi I have all the above running on a single Redhat server
Apache starts fine
PHP config page shows fine on Apache with OCI module loaded
sqlplus scott/tiger@tnsentry> connects fine
sqlplus scott/tiger@//<ip>/<service> connects fine
... but PHP will just not connect to the db
I've tried
oci_connect("scott","tiger","<service>")
OCILogin("scott","tiger","<service>")
OCILogin("scott","tiger","//<ip>:<port>/<service>")
OCILogin("scott","tiger","(CONNECTION=(....))")
and all I can ever get are ORA-12154 and ORA-12514 errors
eg the following line....
if ($c=OCILogon("scott","tiger", "//<ip>:<port>/<service>")) { echo "Successfully connected to Oracle.\n"; oci_close($c); } else { echo "Oracle Connect Error "; print_r(oci_error()); }
gives me....
Oracle Connect Error Array (
=> 12514 [message] => Error while trying to retrieve text for error ORA-12514 [offset] => 0 [sqltext] => )
I've set ORACLE_HOME and ORACLE_SID prior to starting apache
I've tried putenv("ORACLE_HOME=<oracle home path>") in PHP prior to OCILogon
but nothing seems to work and I'm tearing my hair out
One thing to note is that "root" owns apache and "oracle"owns the oracle software so not sure whether this might be a problem and whether it's recommended not to do this?
If anyone can help me with this I would really be grateful - thanks very much in advance!