You are not logged in.

#1 2008-02-01 00:01:14

VuDu
Member
Registered: 2007-05-11
Posts: 95

PHP: ODBC + Oracle Instant Client

Hi there,

I'm have some problems trying to connect to an Oracle DB on PHP, using unixODBC and Oracle's Instant Client.
I've followed every usefull 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. roll

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.:)

Offline

#2 2008-02-09 18:49:34

VuDu
Member
Registered: 2007-05-11
Posts: 95

Re: PHP: ODBC + Oracle Instant Client

Help, anyone? sad

Offline

Board footer

Powered by FluxBB