# FastCGI and Windows

**URL:** <https://rubytalk.org/t/fastcgi-and-windows/16747>\
**Category:** ruby-talk\
**Created:** [28 February 2005 13:14 UTC](https://rubytalk.org/t/fastcgi-and-windows/16747 "2005-02-28T13:14:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert9](https://avatars.discourse-cdn.com/v4/letter/r/fbc32d/32.png) [@Robert9](https://rubytalk.org/u/Robert9)\
**Post date:** [28 February 2005 13:14 UTC](https://rubytalk.org/t/fastcgi-and-windows/16747/1 "2005-02-28T13:14:57Z")

</div>

I have used the Windows installer for FastCGI from RubyForge. I have  
that LoadModule and AddHandler in my conf file per the install file. We  
I navigate to 127.0.0.1/test.fcgi I get the script printed out on the  
screen and not its output.

I am using this script:

#!ruby  
require 'cgi'  
require 'fcgi'

FCGI.each\_cgi do |cgi|  
&nbsp;&nbsp;content = ''  
&nbsp;&nbsp;env = []  
&nbsp;&nbsp;cgi.env\_table.each do |k,v|  
&nbsp;&nbsp;&nbsp;&nbsp;env \<\< [k,v]  
&nbsp;&nbsp;end  
&nbsp;&nbsp;env.sort!  
&nbsp;&nbsp;env.each do |k,v|  
&nbsp;&nbsp;&nbsp;&nbsp;content \<\< %Q(#{k} =\> #{v}\<br\>\n)  
&nbsp;&nbsp;end  
&nbsp;&nbsp;cgi.out{content}  
end

My CGI files run fine.

Robert

---

<div class="post-metadata">

**Author:** ![Dave\_Burt2](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/dave_burt2/32/2036_2.png) [@Dave\_Burt2](https://rubytalk.org/u/Dave_Burt2)\
**Post date:** [28 February 2005 13:35 UTC](https://rubytalk.org/t/fastcgi-and-windows/16747/2 "2005-02-28T13:35:00Z")

</div>

Make sure you have Options +ExecCGI set.

Cheers,  
Dave

> **···**
>
> \<sigzero@gmail.com\> wrote:
> 
> > I have used the Windows installer for FastCGI from RubyForge. I have  
> > that LoadModule and AddHandler in my conf file per the install file. We  
> > I navigate to 127.0.0.1/test.fcgi I get the script printed out on the  
> > screen and not its output.
> > 
> > I am using this script:
> > 
> > \<snip irrelevant script\>
> > 
> > My CGI files run fine.

---

<div class="post-metadata">

**Author:** ![Patrick\_May1](https://avatars.discourse-cdn.com/v4/letter/p/96bed5/32.png) [@Patrick\_May1](https://rubytalk.org/u/Patrick_May1)\
**Post date:** [1 March 2005 17:46 UTC](https://rubytalk.org/t/fastcgi-and-windows/16747/3 "2005-03-01T17:46:39Z")

</div>

Hello,

Quoting sigzero@gmail.com:

> I am using this script:
> 
> #!ruby  
> require 'cgi'  
> require 'fcgi'

'fcgi' does not work on windows. 'fcgi' relies on the names for the  
socket error codes, which are different on windows. Error::XXXX error  
codes are dynamically generated from the operating system.

~ Patrick

---

<div class="post-metadata">

**Author:** ![Robert9](https://avatars.discourse-cdn.com/v4/letter/r/fbc32d/32.png) [@Robert9](https://rubytalk.org/u/Robert9)\
**Post date:** [28 February 2005 16:37 UTC](https://rubytalk.org/t/fastcgi-and-windows/16747/4 "2005-02-28T16:37:24Z")

</div>

I am running Apache2...

Robert

---

<div class="post-metadata">

**Author:** ![Robert9](https://avatars.discourse-cdn.com/v4/letter/r/fbc32d/32.png) [@Robert9](https://rubytalk.org/u/Robert9)\
**Post date:** [28 February 2005 16:37 UTC](https://rubytalk.org/t/fastcgi-and-windows/16747/5 "2005-02-28T16:37:32Z")

</div>

I dropped it into a directory I am serving Perl cgi's out of and it  
still does the same thing.

My site conf looks like this:

&nbsp;&nbsp;&nbsp;&nbsp;Options Indexes FollowSymLinks MultiViews ExecCGI  
&nbsp;&nbsp;&nbsp;&nbsp;AllowOverride None  
&nbsp;&nbsp;&nbsp;&nbsp;Order allow,deny  
&nbsp;&nbsp;&nbsp;&nbsp;Allow from all

---

<div class="post-metadata">

**Author:** ![Patrick\_May1](https://avatars.discourse-cdn.com/v4/letter/p/96bed5/32.png) [@Patrick\_May1](https://rubytalk.org/u/Patrick_May1)\
**Post date:** [1 March 2005 18:37 UTC](https://rubytalk.org/t/fastcgi-and-windows/16747/6 "2005-03-01T18:37:10Z")

</div>

Quoting Patrick May \<patrick@hexane.org\>:

> 'fcgi' does not work on windows. 'fcgi' relies on the names for the  
> socket error codes, which are different on windows. Error::XXXX  
> error codes are dynamically generated from the operating system.

This is a common complaint. I'll take a look at it tonight.

~ Patrick
