4

Well I was wondering if there is any extension for a web server which allows me to "script" in C++ instead of a scripting language like php?

some pseudo code:

#include <iostream>

cout << "<html><title>this is a webpage</title></html>";

I know this sounds silly but I am really wondering if such thing exists.

Or maybe there is something that allows to run compiled C++ code as a webpage from a web server?

11
  • 1
    "PHP server" is a non sequitur, unless you're talking about the PHP 5.4 built-in dev server, which you most certainly aren't from the context. What does this actually have to do with PHP? Are you just looking for a quick and dirty C++-based web application framework ... thing? Commented Jan 4, 2013 at 1:07
  • 1
    What web server are you using? Most are not php specific and allow you to generate pages pretty much any way you want. Commented Jan 4, 2013 at 1:08
  • yeah just looking for a quick way for generating pages from C++ instead of PHP scripts, the webserver I hired has cgi and php support, but I don't think it allows custom extensions to be loaded. have to check that out. But it would be cool to play with it on localhost Commented Jan 4, 2013 at 1:12
  • If I understand this correctly, you are trying to work out how you can configure a web server, which is currently configured for PHP, to serve the output of a program you have written in C++. If you can confirm, you're liking looking at writing CGI scripts in C++. Take a look at geekdaily.net/2007/08/06/c-a-basic-cgi-tutorial Commented Jan 4, 2013 at 1:12
  • 1
    @Gam, if your host supports CGI, then you have your answer. CGI is an API (well, specification, whatever), and any old program can implement it, from a freaking DOS batch file to, well, C++. Commented Jan 4, 2013 at 1:13

1 Answer 1

1

Well, as said in comments you can do what you want using CGI. If your need is to make a webapp using c++, WT is probably the framework you want :

http://www.webtoolkit.eu/wt

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.