<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Thanks Jeff.<br>
      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. <br>
      I can see it in <span style="color: rgb(0, 0, 0); font-family:
        'Courier New', Courier, monospace; font-size: 16px; font-style:
        normal; font-variant: normal; font-weight: normal;
        letter-spacing: normal; line-height: 18px; orphans: auto;
        text-align: start; text-indent: 0px; text-transform: none;
        white-space: normal; widows: auto; word-spacing: 0px;
        -webkit-text-stroke-width: 0px; display: inline !important;
        float: none; background-color: rgb(204, 204, 204);">HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
        Manager\Environment</span><br>
      I'm using x64 MapServer, but the environment variables appear in
      my x64 Python script. <br>
      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. <br>
      <br>
      I think I should also be able to set it in the web.config using
      the following, but also no luck: <br>
      <br>
              <fastCgi><br>
                  <application
      fullPath="C:\Mapserver\bin\mapserv.exe"><br>
                      <environmentVariables><br>
                          <environmentVariable name="CURL_CA_BUNDLE"
      value="C:\Mapserver\bin\curl\curl-ca-bundle.crt" /><br>
                      </environmentVariables><br>
                  </application><br>
              </fastCgi><br>
      <br>
      Regards,<br>
      <br>
      Seth<br>
      <br>
      <br>
      On 09/02/2015 17:02, Jeff McKenna wrote:<br>
    </div>
    <blockquote cite="mid:54D8DA1F.9060109@gatewaygeomatics.com"
      type="cite">On 2015-02-09 10:30 AM, geographika wrote:
      <br>
      <blockquote type="cite">Hi list,
        <br>
        <br>
        There seems to be an issue with running FastCGI under IIS 7.5
        and
        <br>
        environment variables used by MapServer. I need to point to a
        <br>
        curl-ca-bundle.crt file to access a remote WFS server, and it
        appears
        <br>
        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
        <br>
"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
        <br>
<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>
        <br>
        in the browser the "Using CURL_CA_BUNDLE" line does not appear
        and my
        <br>
        certs are not found.
        <br>
        It appears this is not limited to this variable - setting
        MS_ERRORLOG as
        <br>
        a system variable is also ignored.
        <br>
        <br>
        I have checked that the variables are available  using a Python
        script
        <br>
        running in IIS. I've also tried setting up custom environment
        variables
        <br>
        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 *getenv
        *to
        <br>
        retrieve the environment setting, which operates only on the
        data
        <br>
        structures accessible to the run-time library (msvcrt) and not
        on the
        <br>
        environment "segment" created for the process by the operating
        system."
        <br>
        <br>
<a class="moz-txt-link-freetext" 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 -
        <br>
<a class="moz-txt-link-freetext" 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>
        --
        <br>
        web:<a class="moz-txt-link-freetext" href="http://geographika.co.uk">http://geographika.co.uk</a>
        <br>
        twitter: @geographika
        <br>
        <br>
        <br>
        <br>
        <br>
      </blockquote>
      <br>
      MS4W sets that environment variable through an Apache directive;
      for IIS clients using MS4W, I always make sure to set System (not
      User) environment variables, and always always reboot the server
      manually after setting these variables (for some reason, whenever
      I set this up with MS4W on IIS I have to reboot the client's
      server for IIS to "see" them).
      <br>
      <br>
      -jeff
      <br>
      <br>
      <br>
    </blockquote>
    <br>
  </body>
</html>