[unixODBC-support] Doing a SQLDriverConnect fails in Apache with Error 500: "Internal Server Error"

Miguel Rentes miguel.rentes at efacec.pt
Tue Jun 3 11:34:06 BST 2008


Hi everyone!

I'm trying to create a .cgi that makes a connection to Oracle Database 
using unixODBC (in a Red Hat Enterprise Linux 4 machine).

I've successfully compiled Apache (APR 1.2.12, APR-Util 1.2.12, HTTPD 
2.2.8), unixODBC (2.2.12) and PHP (5.2.6) but when I try to run the cgi 
from the web browser I get "Internal Server Error". If I run the same 
cgi from command line it works wih no errors.

Here is my actual configuration:

/usr/local/etc/odbc.ini:

[SXDB]
Application Attributes        = T
Attributes        = W
BatchAutocommitMode        = IfAllSuccessful
CloseCursor        = T
DisableDPM        = F
DisableMTS        = T
Driver        = ORACLE_ODBC_Driver_Linux_ora10g
DSN        = SXDB
EXECSchemaOpt        =
EXECSyntax        = T
Failover        = T
FailoverDelay        = 10
FailoverRetryCount        = 10
FetchBufferSize        = 64000
ForceWCHAR        = F
Lobs        = T
Longs        = T
MetadataIdDefault        = F
QueryTimeout        = T
ResultSets        = T
ServerName        = SXDB
SQLGetData extensions        = F
Translation DLL        =
Translation Option        = 0
UserID        = scatex

/usr/local/etc/odbcinst.ini:

[ORACLE_ODBC_Driver_Linux_ora10g]
Description        = Oracle 10g R2 ODBC Driver for Linux
Driver        = /home/oracle/oraHome1/lib/libsqora.so.10.1
Driver64        =
Setup        =
Setup64        =
UsageCount        = 1
CPTimeout        =
CPReuse        =

[ODBC]
Trace        = Yes
TraceFile        = /tmp/sql.log
ForceTrace        = Yes
Pooling        = Yes

When I run iusql I get:

[oracle at pjs-linux php-5.2.6]$ iusql SXDB scatex Scatex
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> select sysdate from dual;
+--------------------+
| SYSDATE            |
+--------------------+
| 2008-06-03 11:26:26|
+--------------------+
SQLRowCount returns -1
1 rows fetched
SQL> quit

I don't know why Apache is giving me Error 500 but if I run the .cgi 
from command line everything works fine.

My .cgi is just doing a simple select (using SQLDriverConnect) and then 
it disconnects.

 From apache logs I can see:

[Tue Jun 03 11:21:20 2008] [error] [client 172.18.200.62] Debug: 
connect_odbc.c [connect_odbc] - ODBC string 
'DSN=SXDB;UID=scatex;PWD=Scatex;', referer: 
http://172.18.200.153/cgi-bin/get_ret.cgi
[Tue Jun 03 11:21:20 2008] [error] [client 172.18.200.62] connection 
string is: DSN=SXDB;UID=scatex;PWD=Scatex;, referer: 
http://172.18.200.153/cgi-bin/get_ret.cgi
[Tue Jun 03 11:21:20 2008] [error] [client 172.18.200.62] Premature end 
of script headers: lista_alarmes.cgi, referer: 
http://172.18.200.153/cgi-bin/get_ret.cgi

I can only think that Apache doesn't know how to execute 
SQLDriverConnect. But if this is true,how do I make it work?

Any help would be very appreciated. I have no more clues or ideas to 
solve this right now...

Best regards,

Miguel Rentes




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20080603/b01cff28/attachment.html>


More information about the unixODBC-support mailing list