No way to pass arguments to the EXE? [Answered]RSS

6 replies

Last post Mar 18, 2011 11:59 AM by samegoldinButBetter

  • No way to pass arguments to the EXE?

    Oct 09, 2007 02:27 PM|andrew.sears|LINK

    With IIS6, I can use fcgiext.ini to pass arguments to the script interpreter. This works, and I can see the expected Command Line in ProcMon:

    "c:\ruby\bin\ruby.exe" c:\inetpub\wwwroot\myapp\public\dispatch.fcgi

     

    With IIS7, fcgiext.ini is gone, and I haven't found an explicit "Arguments" option in the GUI or the XML config file to replace it. I've tried specifying arguments in the EXE path, but this causes the request to fail immediately. ProcMon never shows ruby.exe starting up. Ruby does execute if I take the arguments out, so I know there aren't any other issues.

  • Re: No way to pass arguments to the EXE?

    Oct 09, 2007 04:49 PM|anilr|LINK

    This can be configured in the system.webServer/fastCgi section as the arguments attribute.  Assuming you have already registered ruby.exe in that section, you would do

    %windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/fastCgi -[fullPath='c:\ruby\bin\ruby.exe'].arguments:c:\inetpub\wwwroot\myapp\public\dispatch.fcgi

    If not already registered, you would do

    %windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/fastCgi -+[fullPath='c:\ruby\bin\ruby.exe',arguments='c:\inetpub\wwwroot\myapp\public\dispatch.fcgi']

     

    Anil Ruia
    Software Design Engineer
    IIS Core Server
  • Re: No way to pass arguments to the EXE?

    Oct 09, 2007 04:58 PM|mvolo|LINK

    Andrew,

    There is currently a problem with the Technical Preview 2 download for Vista, which is causing the Technical Preview 1 bits to be downloaded. 

    The TP1 bits do not have the arguments support, although TP2 bits do have it and allow you to specify the arguments in the <fastCgi> configuration section right alongside the path to the FastCGI program.

    Needless to say the website folks are working on fixing the download.  As soon as its updated, you should be able to download the TP2 bits and use the arguments support in there.

    Sorry for the inconvinience.


    Thanks,

    Mike Volodarsky

    Program Manager
    IIS Core Server
    Visit mvolo.com for more inside information on IIS7, IIS and ASP.NET

    PHP FastCGI Vista

    Mike Volodarsky
    CTO at LeanSentry
    Former IIS/ASP.NET PM

  • Re: No way to pass arguments to the EXE?

    Oct 09, 2007 09:36 PM|andrew.sears|LINK

    Thanks, guys. I'm using Server 2008 RC0, with iisfcgi.dll version 7.0.6001.16659. This is newer than the one in the Vista download, so I'm guessing I do have TP2.

    After adding arguments, I am getting a more descriptive error:

    HTTP Error 500.0 - Internal Server Error
    <handler> scriptProcessor could not be found in <fastCGI> application configuration

    my applicationHost.config:

    ... <fastCgi>
     <application fullPath="c:\ruby\bin\ruby.exe" arguments="c:\inetpub\wwwroot\myapp\public\dispatch.fcgi" />
    </fastCgi> ...

    my web.config:

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
     <system.webServer>
      <handlers>
       <add name="Ruby" path="*" verb="*" modules="FastCgiModule" scriptProcessor="c:\ruby\bin\ruby.exe" resourceType="Unspecified" />
      </handlers>
     </system.webServer>
    </configuration>

    I tried a few other configurations, like copying the scriptProcessor to the application, copying the arguments to the handler, or expanding the scriptProcessor to include the arguments, with no luck.

  • Re: No way to pass arguments to the EXE?

    Oct 10, 2007 01:43 AM|rickjames|LINK

    Hi Andrew,

    Try change your scriptProcessor="fullPath|arguments", e.g. "c:\ruby\bin\ruby.exe|c:\inetpub\wwwroot\myapp\public\dispatch.fcgi". This whacky syntax exists so that FastCGI knows which ruby.exe the scriptProcessor is talking about. (theoretically a web hoster could have 4000 other ruby arguments configured in the fastCgi section)

    Cheerz,

    Rick.

  • Re: No way to pass arguments to the EXE?

    Oct 10, 2007 10:13 AM|andrew.sears|LINK

    Thanks, that did the trick! 

  • Re: No way to pass arguments to the EXE?

    Mar 18, 2011 11:59 AM|samegoldinButBetter|LINK

     If I use this format I am getting:

    HTTP Error 500.0 - Internal Server Error

    <handler> scriptProcessor could not be found in <fastCGI> application configuration

     any idea?

    But this is from web.config which looks like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <directoryBrowse enabled="true" />
            <handlers accessPolicy="Read, Execute, Script">
                <add name="RubyFastCGI" path="*" verb="*" modules="FastCgiModule" scriptProcessor="d:\ruby192\bin\ruby.exe|C:\inetpub\Ruby\myApp\public\public\dispatch.fcgi" resourceType="Unspecified" requireAccess="Execute" />
            </handlers>
        </system.webServer>
        <system.web>
            <authentication mode="Windows" />
            <identity impersonate="true" />
        </system.web>
    </configuration>

     

    but even if I remove the parameter from here i also need to remove it from C:\Windows\System32\inetsrv\config\applicationHost.config:

    <fastCgi>
                <application fullPath="d:\ruby192\bin\ruby.exe"/>
    </fastCgi>
     I will get the same error if I use parameter attribute here.

     

    If I run with no parameters then I get:

    HTTP Error 500.0 - Internal Server Error

    d:\ruby192\bin\ruby.exe - The FastCGI process exited unexpectedly

    Which way should I go? With parameters or without?