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

Stefan Radman Stefan.Radman at CTBTO.ORG
Tue Jun 3 13:05:53 BST 2008


If it works from the command line and doesnt work from a daemon it is
often due to different environments.
I would guess that you lack a library search path for loading Oracle
libraries required by /home/oracle/oraHome1/lib/libsqora.so.10.1
 
Stefan


  _____  

	From: unixodbc-support-bounces at easysoft.com
[mailto:unixodbc-support-bounces at easysoft.com] On Behalf Of Miguel
Rentes
	Sent: Tuesday, 03 June, 2008 12:34
	To: unixodbc-support at easysoft.com
	Subject: [unixODBC-support] Doing a SQLDriverConnect fails in
Apache with Error 500: "Internal Server Error"
	
	
	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/10e2dd6e/attachment.html>


More information about the unixODBC-support mailing list