C++ as CGI

 
Post new topic   Reply to topic    Aprelium Forum Index -> FastCGI/CGI
View previous topic :: View next topic  
Author Message
TByte
-


Joined: 07 Sep 2008
Posts: 1

PostPosted: Sun Sep 07, 2008 8:27 pm    Post subject: C++ as CGI Reply with quote

Hello
I have a question:
I want to have C++ as CGI/FastCGI.
What have I to do for using C++? e.g.:
If I have e perl script, i write:
Code:
use strict;

print "Conten Type: text/html\n\n";
print "<html><body><b>HELLO BROWSER</b></body></html>"

Now I want to can write this:
Code:
#include <iostream>
#include <string>
using namespace std;

int main(string args[])
{
 cout << "Content Type: text/html\n\n";
 cout << "<html><body><b>HELLO BROWSER</b></body></html>";
}

Have anyone an idea?
Thanx already now
---
TByte
Back to top View user's profile Send private message MSN Messenger
rrinc
-


Joined: 24 Feb 2006
Posts: 725
Location: Arkansas, USA

PostPosted: Tue Sep 09, 2008 5:17 am    Post subject: Reply with quote

Compiling C++ apps and using them as CGI is no problem. Your example would work. Just compile it, rename it with a .cgi extension (or whatever you want) then setup Abyss to execute .cgi files. I've done it before.

As for FastCGI I'm not sure.
_________________
-Blake | New Server :D
SaveTheInternet
Soy hispanohablante. Puedes contactarme por mensajes privados.
Back to top View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
genroxbro
-


Joined: 18 Jul 2009
Posts: 3
Location: Canada

PostPosted: Tue Jul 28, 2009 9:18 pm    Post subject: C as CGI Reply with quote

Hi,

I would like to use CGI scripts written in C NOT Perl, but cant get them to work.

I get the infamous "Premature end of script headers" in the error log.

The script is a simple "Hello World", compiled with GCC.
The output looks fine when executed command line.
Permission are 755, so should be fine as well.


thanks.
_____________________________________
Website I designed for express payday loan company.
Back to top View user's profile Send private message Send e-mail ICQ Number
aprelium-support
-


Joined: 20 Feb 2009
Posts: 356

PostPosted: Wed Jul 29, 2009 10:35 am    Post subject: Re: C as CGI Reply with quote

genroxbro wrote:

I get the infamous "Premature end of script headers" in the error log.


Are you sure that you found this error in the Abyss Web Server log ? It looks like an Apache error.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Visit poster's website
CoastResearch
-


Joined: 21 Apr 2009
Posts: 5

PostPosted: Sat Oct 31, 2009 5:44 am    Post subject: Reply with quote

We have provided some C++ examples that all run with the Abyss server. (remeber you will need the C++ distributable installed if you do not address the runtime requirements when you link the project)
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> FastCGI/CGI All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group