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

Miguel Rentes miguel.rentes at efacec.pt
Fri Jun 13 14:46:30 BST 2008

Hi Nick,

If I run the .cgi from the command line I get the following output:

Content-Type: text/html

<head><link rel="stylesheet" href="../styles.css" type="text/css"><META 
bgcolor="#CCCCCC" align="center" class="fText">
Debug: connect_odbc.c [connect_odbc] - ODBC string 
SQL_HANDLE_ENV well allocated!!
SQL_HANDLE_DBC well allocated!!
SQLDriverConnect well done!!

note_file, flag FROM NOTETAG_OPERATION  WHERE  flag <> 'D'  AND  dp_typ 

But when I run it from the web browser I get the "IM004" error. If 
there's a problem with the Apache environment, how can I find the cause? 
I have a .cgi that prints the environment variables under the Apache 
environment but I don't see any that could be missing. Besides the 
environment variables what can also be wrong with the Apache 
environment? I also thought about permissions but I can execute .cgi 
from the web browser, so I eliminated this possibility...

Thanks in advance,

Miguel Rentes

Nick Gorham wrote:
> Miguel Rentes wrote:
>> Hi Nick,
>> I've done a simple .cgi that runs  inside Apache and it works. But 
>> this .cgi I'm working on right now is failing and I can't find the 
>> source of the problem (since it follows the same steps as documented 
>> and as the previous .cgi that worked) or how to correct it.  If 
>> anyone has a clue or a  working example in Linux, please let me know.
>> Thanks in advance,
>> Miguel Rentes
>> Nick Gorham wrote:
>>> Miguel Rentes wrote:
>>>> Hi everyone!
>>>> I'm feeling quite desperate... can anyone help me find out what is 
>>>> going on with SQLDriverConnect? I have manage to solve the problem 
>>>> I had the other day (see bellow) by changing httpd.conf and adding 
>>>> a "PassEnv ORACLE_HOME" directive, but now I have a similar problem 
>>>> in another .cgi, and I don't know what to do. I'm again getting the 
>>>> "IM004" error, which I can't seem to get what I have to do to 
>>>> correct it. This is code that is failing:
>>> I would guess its the same sort of problem, the driver is failing 
>>> for whatever reason when its SQLAllocEnv is called. If the below 
>>> code runs outside Apache, then the difference between the two 
>>> environments must be the problem.
> But does the code you have there run if its run as a stand alone 
> application?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20080613/7453f3f7/attachment.html>

More information about the unixODBC-support mailing list