getting scripts to work

"Rares Marian" <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
I have some scripts that I'm testing to find out how to do this correctly.

This works.

#!/usr/bin/ruby
# rubytesr.fcgi
require 'fcgi'
counter = 0
FCGI.each_cgi('html3') do |cgi|
   counter += 1
   cgi.out {
     cgi.html {
       cgi.body {
         cgi.h1 { "Hello World!" } +
         cgi.p { "Counter: #{counter}" }
       }
     }
   }
end 

These don't.

#!/usr/bin/php
# hellophp.fcgi
<?php
echo "content-type: text/html\n";
echo "\n";
echo "<html>\n";
echo "<body>\n";
echo "<h1>Hello Ruby!</h1>\n";
echo "</body>\n";
echo "</html>\n";
?>

#!/usr/bin/ruby
# helloruby.fcgi
puts "Content-type: text/html"
puts
puts "<html>"
puts "<body>"
puts "<h1>Hello Ruby!</h1>"
puts "</body>"
puts "</html>"

What am I doing wrong?

I get incomplete headers errors in the virtual host logs and failed to remain active for 30 seconds in the server logs.

-- 
_______________________________________________
Check out the latest SMS services @ http://www.linuxmail.org
This allows you to send and receive SMS through your mailbox.

Powered by Outblaze
___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.