<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi list,<br>
    <br>
    There seems to be an issue with running FastCGI under IIS 7.5 and
    environment variables used by MapServer. I need to point to a
    curl-ca-bundle.crt file to access a remote WFS server, and it
    appears this can only be set using an environment variable named
    CURL_CA_BUNDLE. <br>
    <br>
    In brief, if I run the following from the command line:<br>
    <br>
    mapserv -nh
"QUERY_STRING=map=C:\Mapserver\apps\test\test.map&SERVICE=WFS&VERSION=1.1.0&REQUEST=GetCapabilities"<br>
    <br>
    My error log contains <br>
    <br>
    [Mon Feb 09 14:47:29 2015].66000 HTTP: Starting to prepare HTTP
    requests.<br>
    [Mon Feb 09 14:47:29 2015].66000 Using
    CURL_CA_BUNDLE=curl-ca-bundle.crt<br>
    <br>
    If I run
    <a class="moz-txt-link-freetext" href="http://localhost/mapserver/?map=C:\Mapserver\apps\test\test.map&SERVICE=WFS&VERSION=1.1.0&REQUEST=GetCapabilities">http://localhost/mapserver/?map=C:\Mapserver\apps\test\test.map&SERVICE=WFS&VERSION=1.1.0&REQUEST=GetCapabilities</a>
    in the browser the "Using CURL_CA_BUNDLE" line does not appear and
    my certs are not found.<br>
    It appears this is not limited to this variable - setting
    MS_ERRORLOG as a system variable is also ignored. <br>
    <br>
    I have checked that the variables are available  using a Python
    script running in IIS. I've also tried setting up custom environment
    variables for the FastCGI app, played with all sorts of permissions,
    but no luck. <br>
    <br>
    Tamas's blog mentions:<br>
    <br>
    "The main issue here is that most of the libararies use <b>getenv </b>to
    retrieve the environment setting, which operates only on the data
    structures accessible to the run-time library (msvcrt) and not on
    the environment "segment" created for the process by the operating
    system."<br>
    <br>
    <a
href="http://blog.gisinternals.com/2010/12/daily-built-binary-packages-for.html">http://blog.gisinternals.com/2010/12/daily-built-binary-packages-for.html</a><br>
    <br>
    However I'm not sure what the workaround here is exactly. <br>
    This issue appears to have come up before on the list - <a
href="http://lists.osgeo.org/pipermail/mapserver-users/2014-February/075983.html">http://lists.osgeo.org/pipermail/mapserver-users/2014-February/075983.html</a><br>
    Any help appreciated. <br>
    <br>
    Regards,<br>
    <br>
    Seth<br>
    <br>
    <div class="moz-text-html" lang="x-western"> <font color="#888888">--<br>
        web:</font><a href="http://geographika.co.uk"><font
          color="#888888"> </font>http://geographika.co.uk</a><br>
      <font color="#888888">twitter: @geographika<br>
      </font><br>
    </div>
    <br>
    <br>
    <br>
  </body>
</html>