# Problems with fcgi/ruby - "incomplete headers"

**URL:** <https://www.ruby-forum.com/t/problems-with-fcgi-ruby-incomplete-headers/80534>\
**Category:** Ruby\
**Created:** [December 28, 2006, 2:57pm UTC](https://www.ruby-forum.com/t/problems-with-fcgi-ruby-incomplete-headers/80534 "2006-12-28T14:57:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tiago\_Cruz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e47774/32.png) [@Tiago\_Cruz](https://www.ruby-forum.com/u/Tiago_Cruz)\
**Post date:** [December 28, 2006, 2:57pm UTC](https://www.ruby-forum.com/t/problems-with-fcgi-ruby-incomplete-headers/80534/1 "2006-12-28T14:57:47Z")

</div>

Hello guys,

I’m newbie on ruby world, and I hope understood this program soon 😉

The error on log is “FastCGI: incomplete headers (0 bytes) received from  
server” and all the places that I read says this like one problem with  
fcgi, so I’m trying to reinstall it.

=========================================================================================

# gem uninstall fcgi

Successfully uninstalled fcgi version 0.8.7

# gem install fcgi

Need to update 18 gems from [http://gems.rubyforge.org](http://gems.rubyforge.org)  
…  
complete  
Building native extensions. This could take a while…  
ruby extconf.rb install fcgi  
checking for fcgiapp.h… yes  
checking for FCGX\_Accept() in -lfcgi… yes  
creating Makefile

make  
gcc -I. -I. -I/usr/local/lib/ruby/1.8/x86\_64-linux -I. -DHAVE\_FCGIAPP\_H  
-fPIC -g -O2 -fPIC -c fcgi.c  
gcc -shared -L’/usr/local/lib’ -Wl,-R’/usr/local/lib’ -o fcgi.so fcgi.o  
-Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -L. -lruby -lfcgi -ldl  
-lcrypt -lm -lc

make install  
/usr/bin/install -c -m 0755 fcgi.so  
/usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib

# make clean Successfully installed fcgi-0.8.7

But not works. When I try compile to my self, don’t works because the  
directory is not the same, and the application can’t “see” the module:

# ========================================================================================= sites-12:/src/ruby/ruby-fcgi-0.8.7 # ruby install.rb setup —\> lib \<— lib —\> ext —\> ext/fcgi make gcc -I. -I. -I/usr/local/lib/ruby/1.8/x86\_64-linux -I/iG/src/ruby/ruby-fcgi-0.8.7/ext/fcgi -DHAVE\_FCGIAPP\_H -fPIC -g -O2 -fPIC -c fcgi.c gcc -shared -L’/usr/local/lib’ -Wl,-R’/usr/local/lib’ -o fcgi.so fcgi.o -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -L. -lruby -lfcgi -ldl -lcrypt -lm -lc \<— ext/fcgi \<— ext sites-13:/iG/src/ruby/ruby-fcgi-0.8.7 # ruby install.rb install rm -f InstalledFiles —\> lib mkdir -p /usr/local/lib/ruby/site\_ruby/1.8 install fcgi.rb /usr/local/lib/ruby/site\_ruby/1.8/ \<— lib —\> ext —\> ext/fcgi mkdir -p /usr/local/lib/ruby/site\_ruby/1.8/x86\_64-linux install fcgi.so /usr/local/lib/ruby/site\_ruby/1.8/x86\_64-linux/. \<— ext/fcgi \<— ext

Can you see?  
Using gem.: /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib  
Using ruby: /usr/local/lib/ruby/site\_ruby/1.8/x86\_64-linux/

Well… I tried to make symlink and/or copy the .so file, but don’t  
works yet.

I’m using SuSE Enterprise Server 9 x86\_64, with all compiled:  
mod\_fastcgi-2.4.2.tar.gz / mod\_ruby-1.2.6.tar.gz  
ruby-1.8.5.tar.gz / ruby-fcgi-0.8.7.tar.gz  
fcgi-2.4.0.tar.gz / mod\_fcgid.1.10.tar.gz

On apache, I’m tried the fastcgi\_module and the fcgid\_module, but I  
can’t do applications works with any one ☹

Thanks a lot!  
Happy new year for all!

---

<div class="post-metadata">

**Author:** ![Tiago\_Cruz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e47774/32.png) [@Tiago\_Cruz](https://www.ruby-forum.com/u/Tiago_Cruz)\
**Post date:** [December 28, 2006, 4:02pm UTC](https://www.ruby-forum.com/t/problems-with-fcgi-ruby-incomplete-headers/80534/2 "2006-12-28T16:02:00Z")

</div>

Tiago Cruz wrote:

> Hello guys,
> 
> I’m newbie on ruby world, and I hope understood this program soon 😉
> 
> The error on log is “FastCGI: incomplete headers (0 bytes) received from  
> server” and all the places that I read says this like one problem with  
> fcgi, so I’m trying to reinstall it.

Hmm. Are you sure this is a problem with FCGI itself? The error looks  
similar to the dreaded regular CGI “premature end of script headers”,  
which is usually a problem in your application code.

David V.

---

<div class="post-metadata">

**Author:** ![Tiago\_Cruz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e47774/32.png) [@Tiago\_Cruz](https://www.ruby-forum.com/u/Tiago_Cruz)\
**Post date:** [December 28, 2006, 5:46pm UTC](https://www.ruby-forum.com/t/problems-with-fcgi-ruby-incomplete-headers/80534/3 "2006-12-28T17:46:41Z")

</div>

Hello David,

On Fri, 2006-12-29 at 00:00 +0900, David V. wrote:

> Hmm. Are you sure this is a problem with FCGI itself? The error looks  
> similar to the dreaded regular CGI “premature end of script headers”,  
> which is usually a problem in your application code.

Really. But this application was working hosted on dreamhost now… and  
I’m getting to work here now. So, I think that the problem is another…

Thanks!
