[mapserver-users] MapServer Environment Variables and IIS

geographika geographika at gmail.com
Tue Feb 10 05:18:19 PST 2015


Some further details after debugging. I modified mmaphttp.c and 
recompiled MapServer just to confirm the missing environment variables.

   // pszCurlCABundle = "C:\\MapServer\\bin\\curl\\curl-ca-bundle.crt"; 
// works when hardcoded
   pszCurlCABundle = getenv("Path");
   msDebug("Test CURL_CA_BUNDLE=%s\n", pszCurlCABundle);

   test1 = getenv("Path");
   msDebug("Path=%s\n", test1);

Then run using mapserv the env variables are correct. When run in IIS 
using FastCGI both appear as null in the log file.

[Tue Feb 10 13:54:13 2015].868000 Test CURL_CA_BUNDLE=(null)
[Tue Feb 10 13:54:13 2015].868000 Path=(null)

getenv is part of the standard C library 
http://www.codingunit.com/c-reference-stdlib-h-function-getenv
So I guess this must be an IIS/FastCGI issue rather than MapServer?

Seth

On 09/02/2015 21:48, Jeff McKenna wrote:
> On 2015-02-09 1:03 PM, geographika wrote:
>> Thanks Jeff.
>> The environment variable is definitely set in system variables, and I've
>> rebooted a few times now. It also happens on both a w08r2 server and a
>> Windows 7 machine.
>> I can see it in
>> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
>> Manager\Environment
>> I'm using x64 MapServer, but the environment variables appear in my x64
>> Python script.
>> I had this working a couple of years ago, and tried to see if anything
>> has changed in the MS source since but no luck.
>>
>> I think I should also be able to set it in the web.config using the
>> following, but also no luck:
>>
>>          <fastCgi>
>>              <application fullPath="C:\Mapserver\bin\mapserv.exe">
>>                  <environmentVariables>
>>                      <environmentVariable name="CURL_CA_BUNDLE"
>> value="C:\Mapserver\bin\curl\curl-ca-bundle.crt" />
>>                  </environmentVariables>
>>              </application>
>>          </fastCgi>
>>
>> Regards,
>>
>> Seth
>>
>>
>
> I think I may been in your exact shoes once, and it was a problem with 
> the Curl library in the MapServer build (I believe Curl is used for 
> this certification/communication, along with the OpenSSL, but you 
> could clarify this with other developers).  I would also test with 
> MS4W to see if you get the same problem.
>
> I think you said it used to work with an older MapServer version; I 
> would therefore test on that same server with that same older 
> MapServer version/package again too.
>
> Ha, this is how I debug (yes gives you grey hairs ha!).
>
> -jeff
>
>
>




More information about the MapServer-users mailing list