Skip to Main Content

Infrastructure Software

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!

PHP: ODBC + Oracle Instant Client

620860Feb 1 2008
Hi there,

I'm also having some problems trying to connect to an Oracle DB on PHP, using unixODBC and Oracle's Instant Client.
I've followed every useful information from tutorials that Google pointed to but when I try to test the connection with isql I always get this error:
#  isql -v SPIDER
[08004][unixODBC][Oracle][ODBC][Ora]ORA-12154: TNS:could not resolve the connect identifier specified

[ISQL]ERROR: Could not SQLConnect
For what I've found this problem seems to be very frequent but most of the help applies to the windows.
I've been retrying and searching for too long so I need some outside and more experienced help. :rolleyes:

This is my /opt/oracle/instantclient:
/opt/oracle/instantclient #  ls -l
total 102716
-r-xr-xr-x 1 root root    91881 2006-11-15 20:38 ODBCRelnotesJA.htm
-r-xr-xr-x 1 root root    58416 2006-11-15 20:38 ODBCRelnotesUS.htm
-r--r--r-- 1 root root    21548 2006-11-15 20:38 ODBC_IC_Readme_Linux.html
-rw-r--r-- 1 root root      387 2008-01-31 23:17 TNSNAMES.ORA
-r--r--r-- 1 root root  1600090 2006-11-15 20:37 classes12.jar
-rwxrwxr-x 1 root root    67053 2006-11-15 20:37 genezi
-r--r--r-- 1 root root     1525 2006-11-15 20:38 glogin.sql
-rwxrwxr-x 1 root root 18825267 2006-11-15 20:37 libclntsh.so.10.1
-r-xr-xr-x 1 root root  5486009 2006-11-15 20:37 libnnz10.so
-rwxrwxr-x 1 root root  1398088 2006-11-15 20:37 libocci.so.10.1
-rwxrwxr-x 1 root root 72480394 2006-11-15 20:37 libociei.so
-r-xr-xr-x 1 root root   120135 2006-11-15 20:37 libocijdbc10.so
-r-xr-xr-x 1 root root  1057777 2006-11-15 20:38 libsqlplus.so
-r-xr-xr-x 1 root root  1434235 2006-11-15 20:38 libsqlplusic.so
lrwxrwxrwx 1 root root       16 2008-01-31 23:05 libsqora.so.1 -> libsqora.so.10.1
-rwxrwxr-x 1 root root   772395 2006-11-15 20:38 libsqora.so.10.1
-r--r--r-- 1 root root     3457 2006-11-15 20:38 odbc_update_ini.sh
-r--r--r-- 1 root root  1545954 2006-11-15 20:37 ojdbc14.jar
drwxrwxr-x 4 root root     4096 2006-11-15 20:38 sdk
-r-xr-xr-x 1 root root     8867 2006-11-15 20:38 sqlplus
My odbc.ini:
[SPIDER]
Description     = BD database test
Driver          = oracle-driver
Server          = spider.di.uminho.pt
Database        = TRABS
Port            = 1521
and my odbcinst.ini:
[oracle-driver]
Description     = Oracle ODBC driver for Oracle 11g
Driver          = /opt/oracle/instantclient/libsqora.so.1
FileUsage = 1
My TNSNAMES.ORA:
SPIDER = 
  (DESCRIPTION = 
    (ADDRESS_LIST = 
      (ADDRESS = 
        (PROTOCOL = TCP)
        (HOST = spider.di.uminho.pt)
        (PORT = 1521)
      )
    )
    (CONNECT_DATA = 
      (SERVICE_NAME = TRABS)
    )
  )
My env:
TWO_TASK=TRABS
LD_LIBRARY_PATH=/opt/oracle/instantclient
TNS_ADMIN=/opt/oracle/instantclient
PATH=/opt/oracle/instantclient:/bin:/usr/bin:/sbin:/usr/sbin:/usr/X11R6/bin:/opt/bin:/usr/share/eclipse:/opt/java/bin:/opt/java/jre/bin:/opt/mozilla/bin
ORACLE_HOME=/opt/oracle/instantclient
I've wasted many hours on this, but I think I'm about to give up to this last error.
This page http://ora-12154.ora-code.com/ points to problems accessing/reading the TNSNAMES.ORA but I can't see what's wrong with my configuration.

Any help would be really appreciated.:)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 29 2008
Added on Feb 1 2008
0 comments
2,174 views