Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DB Connection Problem: Redhat 4.1-Oracle 10.2-Apache 2.0.54-PHP 5.0.4

295321Aug 15 2005 — edited Aug 17 2005
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!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 14 2005
Added on Aug 15 2005
4 comments
1,033 views