WFastCGI issue loading cx_Oracle

Sep 3 at 3:49 PM
This may not be the best location for this question, but I can't think of a better, so here goes. I've managed to get WFastCGI working with a very simple test Django application, and so my next step is to move on to my real application. Unfortunately, when I try to load the application, I get an Error returned, saying "Error loading cx_Oracle module: DLL load failed: The specified module could not be found". I don't understand why this would occur, as I've confirmed that the virtualenv python exe I'm using can load that module without any problem. I've an Oracle client and can connect without problem to my database.

My website is configured correctly to the point that the wfastcgi handler is running and trying to import everything. As you can tell, I'm a n00b with IIS and WFastCGI, so any suggestions/guidance you can provide, even if it's a different place to ask my question, will be greatly appreciated. Thanks in advance.
Coordinator
Sep 3 at 5:37 PM
Are you running this locally or on Windows Azure Web Sites? One possibility might be a difference between 32-bit vs 64-bit environments.

If you're running locally can you post your configuration for your handler in applicationHost.config and your web.config?
Sep 3 at 7:06 PM
I'm running it locally, on Windows 2012 with IIS 8.5. testd is the simple Django app that works, sdcgis is the real app, the one causing the problem.

web.config:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <appSettings>
        <add key="WSGI_HANDLER" value="django.core.handlers.wsgi.WSGIHandler()" />
        <add key="DJANGO_SETTINGS_MODULE" value="sdcgis.settings" />
        <add key="PYTHONPATH" value="C:\sdcgis;C:\Python27\Lib\site-packages;C:\Virtual\Django165\Lib\site-packages" />
    </appSettings>
    <system.webServer>
      <handlers>
        <clear/>
        <add name="WFastCGI" path="*" verb="*" modules="FastCgiModule" scriptProcessor="C:\Virtual\Django165\Scripts\python.exe|c:\Python27\Scripts\wfastcgi.py" resourceType="Either" requireAccess="Script" />
      </handlers>
    </system.webServer>
</configuration>
applicationHost.config (I guessed at what you'll need, it's too large to post in its entirety):
...
        <applicationPools>
            <add name="DefaultAppPool" autoStart="true" enable32BitAppOnWin64="true" />
            <add name="Default Web Site" />
            <add name="sdcgis" />
            <add name="testd" autoStart="true" enable32BitAppOnWin64="false" />
            <applicationPoolDefaults managedRuntimeVersion="v4.0">
                <processModel identityType="ApplicationPoolIdentity" />
            </applicationPoolDefaults>
        </applicationPools>
...
<sites>
            <site name="Default Web Site" id="1">
                <application path="/" applicationPool="Default Web Site">
                    <virtualDirectory path="/" physicalPath="C:\inetpub\wwwroot" />
                </application>
                <bindings>
                    <binding protocol="http" bindingInformation="*:80:" />
                </bindings>
            </site>
            <site name="testd" id="2" serverAutoStart="true">
                <application path="/" applicationPool="testd">
                    <virtualDirectory path="/" physicalPath="C:\inetpub\wwwroot\testd" />
                </application>
                <bindings>
                    <binding protocol="http" bindingInformation="*:8000:" />
                </bindings>
                <traceFailedRequestsLogging enabled="true" />
            </site>
            <site name="sdcgis" id="3" serverAutoStart="true">
                <application path="/" applicationPool="sdcgis">
                    <virtualDirectory path="/" physicalPath="C:\sdcgis" />
                </application>
                <bindings>
                    <binding protocol="http" bindingInformation="*:82:" />
                </bindings>
            </site>
            <siteDefaults>
                <logFile logFormat="W3C" directory="%SystemDrive%\inetpub\logs\LogFiles" />
                <traceFailedRequestsLogging directory="%SystemDrive%\inetpub\logs\FailedReqLogFiles" />
            </siteDefaults>
            <applicationDefaults applicationPool="DefaultAppPool" />
            <virtualDirectoryDefaults allowSubDirConfig="true" />
        </sites>
...
<fastCgi>
            <application fullPath="C:\Virtual\Django165\Scripts\python.exe" arguments="C:\Python27\Scripts\wfastcgi.py" monitorChangesTo="" stderrMode="ReturnStdErrIn500" maxInstances="4" idleTimeout="300" activityTimeout="30" requestTimeout="90" instanceMaxRequests="200" protocol="NamedPipe" queueLength="1000" flushNamedPipe="false" rapidFailsPerMinute="10" />
        </fastCgi>
Sep 19 at 9:24 PM
Not sure why this didn't work, but I completely removed Python and all related items, and then cleaned out any cx_Oracle entries in the registry. Then I reinstalled everything and it's working now.
Marked as answer by holyoaks on 9/19/2014 at 2:24 PM