php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3448 odbc_connect problem with PHP4 and oracle
Submitted: 2000-02-10 12:29 UTC Modified: 2000-06-20 12:08 UTC
From: drax at usa dot net Assigned:
Status: Closed Package: ODBC related
PHP Version: 4.0 Beta 3 OS: NT 4
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: drax at usa dot net
New email:
PHP Version: OS:

 

 [2000-02-10 12:29 UTC] drax at usa dot net
After migrating from PHP3 to PHP4 Beta3 I encounter a problem with odbc_connect.
The error result from the ODBC driver (oracle) reads:
"SQL error: [Microsoft][ODBC driver for Oracle][Oracle]ORA-12154: TNS:Unable to resolve Servicename., SQL state 08001 in SQLConnect in ... - Can't connect to database"
I started a trace and couldn't see any differences except that the connect failed.
The same script / DSN configuration works fine with PHP3 3.0.14

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-02-29 06:25 UTC] drax at usa dot net
A few more details:
PHP3 (ODBC Driver) finds the TNS information in c:/orant/net80/admin/tnsnames.ora
PHP4 (no idea what it has to do with tnsnames) doesn't even find tnsnames.ora
(found that out when I renamed the file tnsnames.ora)

Someone stated that PHP4 provides a different environment for locating the tnsnames.ora file. 
Any ideas on that?

Logfile:
php             159:71	ENTER SQLAllocEnv
		HENV *              0x00322820

php             159:71	EXIT  SQLAllocEnv  with return code 0 (SQL_SUCCESS)
		HENV *              0x00322820 ( 0x00ca1440)

php             159:71	ENTER SQLAllocConnect
		HENV                0x00ca1440
		HDBC *              0x00322824

php             159:71	EXIT  SQLAllocConnect  with return code 0 (SQL_SUCCESS)
		HENV                0x00ca1440
		HDBC *              0x00322824 ( 0x00ca14e8)

php             159:71	ENTER SQLSetConnectOption
		HDBC                0x00ca14e8
		UWORD                      110 <SQL_ODBC_CURSORS>
		UDWORD                     1

php             159:71	EXIT  SQLSetConnectOption  with return code 0 (SQL_SUCCESS)
		HDBC                0x00ca14e8
		UWORD                      110 <SQL_ODBC_CURSORS>
		UDWORD                     1

php             159:71	ENTER SQLConnectW
		HDBC                0x00ca14e8
		WCHAR *             0x00ca15f0 [      -3] "aur001\ 0"
		SWORD                       -3
		WCHAR *             0x1f4be068 [      -3] "******\ 0"
		SWORD                       -3
		WCHAR *             0x1f4be068 [      -3] "******\ 0"
		SWORD                       -3

php             159:71	EXIT  SQLConnectW  with return code -1 (SQL_ERROR)
		HDBC                0x00ca14e8
		WCHAR *             0x00ca15f0 [      -3] "aur001\ 0"
		SWORD                       -3
		WCHAR *             0x1f4be068 [      -3] "******\ 0"
		SWORD                       -3
		WCHAR *             0x1f4be068 [      -3] "******\ 0"
		SWORD                       -3

		DIAG [08001] [Microsoft][ODBC driver for Oracle][Oracle]ORA-12154: TNS:Der Servicename konnte nicht aufgel?st werden.
 (12154)

php             159:71	ENTER SQLErrorW
		HENV                0x00ca1440
		HDBC                0x00ca14e8
		HSTMT               0x00000000
		WCHAR *             0x0012fb64 (NYI)
 		SDWORD *            0x0012fbb0
		WCHAR *             0x0012f764
		SWORD                      254
		SWORD *             0x0012fbae

php             159:71	EXIT  SQLErrorW  with return code 0 (SQL_SUCCESS)
		HENV                0x00ca1440
		HDBC                0x00ca14e8
		HSTMT               0x00000000
		WCHAR *             0x0012fb64 (NYI)
 		SDWORD *            0x0012fbb0 (12154)
		WCHAR *             0x0012f764 [     105] "[Microsoft][ODBC driver for Oracle][Oracle]ORA-12154"
		SWORD                      254
		SWORD *             0x0012fbae (105)

php             159:71	ENTER SQLErrorW
		HENV                0x00ca1440
		HDBC                0x00ca14e8
		HSTMT               0x00000000
		WCHAR *             0x0012fb64 (NYI)
 		SDWORD *            0x0012fbb0
		WCHAR *             0x0012f764
		SWORD                      254
		SWORD *             0x0012fbae

php             159:71	EXIT  SQLErrorW  with return code 100 (SQL_NO_DATA_FOUND)
		HENV                0x00ca1440
		HDBC                0x00ca14e8
		HSTMT               0x00000000
		WCHAR *             0x0012fb64 (NYI)
 		SDWORD *            0x0012fbb0
		WCHAR *             0x0012f764
		SWORD                      254
		SWORD *             0x0012fbae

php             159:71	ENTER SQLFreeConnect
		HDBC                0x00ca14e8

php             159:71	EXIT  SQLFreeConnect  with return code 0 (SQL_SUCCESS)
		HDBC                0x00ca14e8

 [2000-02-29 09:24 UTC] kara at cvs dot php dot net
The Oracle ODBC driver is only a kind of "wrapper" around the
oracle OCI libraries. So it seems as if the environment that
php runs in is different for your php3 and php4 installation.
BTW: ODBC Support in Beta4 is broken, working again in CVS
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 09 11:01:34 2025 UTC