Home » RDBMS Server » Networking and Gateways » cant connect with OCI8 using php5.2.5 (php5.2.5, oracle instant client 10.2.3, apache 2.2.8)
cant connect with OCI8 using php5.2.5 [message #317511] Thu, 01 May 2008 14:31 Go to next message
aliyesami
Messages: 28
Registered: October 2005
Location: Florida
Junior Member
I can see the oci8 module is loaded but when I try to connect I get the error "
Warning: oci_connect() [function.oci-connect]: ORA-12154: TNS:could not resolve the connect identifier specified in /usr/local/apache/htdocs/testoci.php on line 6
"


NOTE: from oracle account I can connect to "emrep" using sqlplus so i know the tns entry is good.
Re: cant connect with OCI8 using php5.2.5 [message #317516 is a reply to message #317511] Thu, 01 May 2008 15:09 Go to previous messageGo to next message
BlackSwan
Messages: 25033
Registered: January 2009
Location: SoCal
Senior Member
> from oracle account I can connect to "emrep" using sqlplus so i know the tns entry is good.

You may be correct in the statement above, then again maybe not.
See we only know what you post. We can't see what you see.

How many different computer systems are involved & what are their names?

using sqlplus along with CUT & PASTE show us the whole session where "emrep" connects to the database.

post the snippet of php code which fails to connect to the DB?

When was the last time php successfully connected to Oracle?
What changed?

Please respond to each & every request/question.
Re: cant connect with OCI8 using php5.2.5 [message #317519 is a reply to message #317511] Thu, 01 May 2008 15:29 Go to previous messageGo to next message
aliyesami
Messages: 28
Registered: October 2005
Location: Florida
Junior Member
well I connect to the same database using php installed on my laptop (xampp release) connecting to the same tns entry .

the php code and connect string is shown below, which works fine on the pc with xampp version and is failing on the solaris 9 box with tns entry not found error.


<?php
$conn = oci_connect('SAMI', 'SAMI', 'emrep');
<?

$ sqlplus sami/sami@emrep

SQL*Plus: Release 10.2.0.3.0 - Production on Thu May 1 16:26:30 2008

Copyright (c) 1982, 2005, Oracle. All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

SQL>

it never worked on solaris9, with oci8 support.

can you give me a working ./configuration commands for compiling apache and php with oci8 ?
i am reading online that the error i am experiencing can also be caused if php is not compiled in CGI mode .

Re: cant connect with OCI8 using php5.2.5 [message #317520 is a reply to message #317511] Thu, 01 May 2008 15:37 Go to previous messageGo to next message
BlackSwan
Messages: 25033
Registered: January 2009
Location: SoCal
Senior Member
You should also follow Posting Guideline as stated in URL below.
http://www.orafaq.com/forum/t/88153/0/

I have no idea on which system & OS Oracle RDBMS is running.
I have no idea on which system & OS Apache/PHP is running.
I have no idea from which system sqlplus was launched.

> is failing on the solaris 9 box with tns entry not found error.
This needs to be fixed.

Good Luck with solving your problem(s).

[Updated on: Thu, 01 May 2008 15:47] by Moderator

Report message to a moderator

Re: cant connect with OCI8 using php5.2.5 [message #317521 is a reply to message #317520] Thu, 01 May 2008 16:02 Go to previous messageGo to next message
aliyesami
Messages: 28
Registered: October 2005
Location: Florida
Junior Member
sorry if I my posting was out of guidline , here is all the information you asked :

- php5.2.5, Apache2.2.8, oracle basic client 10.2.0.3, RDBMS oracle 10.2.0.3 , all running on one box solaris 9.
- sqlplus launced from the box also ..it has the tns entry. also from my laptop sqlplus works as the same tns entry is in my laptop .

> is failing on the solaris 9 box with tns entry not found error.
This needs to be fixed.

what do you mean by this i dont get it
Re: cant connect with OCI8 using php5.2.5 [message #317522 is a reply to message #317511] Thu, 01 May 2008 16:12 Go to previous messageGo to next message
BlackSwan
Messages: 25033
Registered: January 2009
Location: SoCal
Senior Member
one solution would be to install & use XAMPP on the solaris box.

I suspect that Apache/PHP process does not have the necessary Oracle environmental variables defined (or set incorrectly).
Re: cant connect with OCI8 using php5.2.5 [message #317696 is a reply to message #317511] Fri, 02 May 2008 10:53 Go to previous message
aliyesami
Messages: 28
Registered: October 2005
Location: Florida
Junior Member
the xampp on solaris does not have oci8 support since the php that comes with it is not compiled with oci8 version, I tried it and it never worked.
Previous Topic: Oracle 9i on Windows2003 and tunnel with Client SSH
Next Topic: ORA-12535 TNS: Operation Timed Out
Goto Forum:
  


Current Time: Sat Dec 03 03:52:30 CST 2016

Total time taken to generate the page: 0.08729 seconds