ID: 5814
Updated by: cynic
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Closed
Bug Type: ODBC related
Assigned To: 
Comments:



Previous Comments:
---------------------------------------------------------------------------

[2001-01-11 17:09:33] [EMAIL PROTECTED]
did you encounter this bug in later (preferrably 4.0.4) versions of PHP?

---------------------------------------------------------------------------

[2000-07-28 21:38:16] [EMAIL PROTECTED]
Just an addition:

The same bug occurs using Windows98 and Apache Web Server. The connection to Oracle 
via ODBC works with php3 and other ODBC-clients and fails with php4, where TNS cannot 
resolve the Oracle alias.

Regards,
Frank

---------------------------------------------------------------------------

[2000-07-28 16:09:21] [EMAIL PROTECTED]
This is the c function that works, and it shows no big difference to the 
odbc_sqlconnect function used by php4:


void myodbcconnect()
{
        int rc;
        SQLHANDLE henv,hdbc;

        
        SQLAllocEnv(&henv);
        SQLAllocConnect(henv, &hdbc);
        

        rc = SQLConnect(hdbc,(unsigned char*)dsn,strlen(dsn),(unsigned 
char*)uid,strlen(uid),(unsigned char*)pwd,strlen(pwd));
        
        
        if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
                MessageBox(hWnd,"","Fehler",IDOK);
                SQLFreeConnect(hdbc);

        }
        else
                MessageBox(hWnd,"OK","",IDOK);

}


---------------------------------------------------------------------------

[2000-07-28 14:06:42] [EMAIL PROTECTED]
No, both php3 and php4 run as CGI, and with the same user. Also, everyone has full 
access to the tnsnames.ora.

I have configured Apache the way that scripts ending with .php4 are executed by php4 
and scripts ending with .php3 by php3. A script, run as "test.php4" fails, the same 
run as "test.php3" succeeds. Everything runs as CGI, not as Apache module.

I have written a small test-program with C, and there the connection using SQLConnect 
works, as well as with php3. Somehow, in php4 the same function call (SQLConnect) 
returns SQL_ERROR.

In php3 and my test-program, SQLConnect finds the missing parameters DBQ and ASY from 
the ODBC-driver and can resolve the DBQ setting, in php4 it also finds the DBQ and ASY 
parameters, but cannot resolve the DBQ, though there is no obvious difference in the 
environment (same users, same machine, same browser). Anyhow, the php_odbc.c source 
does not show me any hint why this behaviour occurs, and it appears to be a different 
environment, but then the same occurs on different machines. Always, php3 works, php4 
does not work, other ODBC-clients work. 

One idea is: in php3, the SQLConnect runs from the exe, in php4 from a dll (even in 
the CGI-version), and the TNS-resolution does not work there?
That's the only difference I have found so far.

If i Find more, I'll update this report.

Best regards,
Frank

---------------------------------------------------------------------------

[2000-07-28 09:06:30] [EMAIL PROTECTED]
There must be something different in the environment between php3 and php4. 
The oracle error you're getting implies that the oracle libs aren't able to find 
tnsnames.ora.
Maybe you are running php3 as cgi and php4 as ISAPI?
Or do you have a different user executing the scripts? 

---------------------------------------------------------------------------

The remainder of the comments for this report are too long.  To view the rest of the 
comments, please view the bug report online.

Full Bug description available at: http://bugs.php.net/?id=5814


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to