我想开始开发 CGI,但我对此很陌生

发布于 2024-08-04 17:41:45 字数 644 浏览 2 评论 0原文

我想用 C++ 开发我的下一个 Web 项目 FastCGI,但我不知道如何开始,而且 google 对此也不是很友好。 我真的不太了解 fastCGI 或其他使 cgi 持久化的库...尝试阅读一些东西,但它似乎与 Linux 和所有这些 .configure Makefiles 等一起使用...

任何人都可以给我一个基本教程但这有点详细吗? 我有 Windows Vista SP1,IIS 配置为接受 CGI,我也有 Visual Studio 2008 和 DevC++。

我从 fastcgi.com 下载了该套件,但很难理解它的基础知识。 一个关于使用 fastcgi(任何我可以使用持久代码的库)构建 hello world 的真正简单的方法将非常好。

说实话,我不知道是否可以将 fastcgi 项目中的文件包含到我的项目中并将两者一起编译,这是否适用于我的 IIS。 即使这可行,我也不知道应该从 fastCGI 开发工具包构建哪一个,有一个 cgi-fcgi 和 libfcgi 文件夹,其中包含文件,并且几乎所有文件夹中都放置了 Makefile -_-"...

我知道 C++ 中的 CGI 很难开发,因为它不使用模板,而且您必须负责内存管理......但我想尝试一下。 我有点厌倦了脚本语言及其限制。

抱歉我的英语,我希望我说得足够清楚。

谢谢, 乔

I want to develop my next web project in C++ as FastCGI but I don't know how to start and google wasn't very friendly about this.
I really don't know much about fastCGI or others libraries that makes cgi persistent... Tried to read some stuff, but it seems to be used along Linux with all those .configure Makefiles etc...

can anyone give me a basic tutorial but kinda detailed about this?
I have windows vista sp1 and IIS is configured to accept CGI, I have Visual Studio 2008 and DevC++ too.

I downloaded the kit from fastcgi.com but its hard to understand the basics of it.
A real simple howto on building a hello world, using fastcgi(any library that I can use persistent code) would be very nice.

The basics, seriously, like I don't know if I can just include the files from the a fastcgi project to my project and compile both together, if that will work with my IIS.
Even if that would work, I don't know which one I should build from fastCGI dev kit, there is a cgi-fcgi and libfcgi folders with files in them and there is Makefiles placed in almost all folders -_-"...

I know that CGI in C++ is dificult to develop because it doesn't use templates and because you must take care of memory managment... But I want to give it a try.
I am kinda tired of scripting languages and their restrictions/limitations.

Sorry my english, I hope I was clear enough.

Thanks,
Joe

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

无畏 2024-08-11 17:41:45

我不建议您将 FastCGI 与 IIS 一起使用。 IIS 对 FastCGI 的支持非常有限——它只允许通过管道进行通信,并且只传递一个请求来进行处理。

FastCGI 被添加到 IIS 中,以某种方式将 PHP 和其他几种技术连接到 IIS。

如果您想用 C++ 创建 Web 应用程序,我建议您使用非 MS 开发环境。

关于编程。很少有工具可以在 Web 上使用 C++,特别是对于 MS 环境:

  1. 您可以直接使用 libfcgi 并自行解析查询——这是一项艰巨的工作,但对于非常简单的任务来说,这很好。
  2. 您可以使用一些更高级别的库,例如 CgiCC - 它对于一些基本的东西很有用,例如表单、cookie,但仍然相当有限。
  3. 您可以使用完整的 MVC Web 框架,例如 CppCMS。但我不建议您为此目的在 Windows 环境中工作。
  4. 您还可以尝试 Wt 进行“GUI-over-Web”开发风格。

I would not recommend you to use FastCGI with IIS. IIS support of FastCGI is very limited -- it allows communication only over pipes and only one request is passed to process.

FastCGI was added to IIS to somehow connect PHP and several other technologies to IIS.

If you want to create web applications in C++ I would recommend you to use non-MS development environment.

About programming. There are few tools to work with C++ for web, especially for MS environment:

  1. You may work directly with libfcgi and parse queries on your own -- quite a hard job but for very simple tasks it is fine.
  2. You may use some higher level libraries like CgiCC -- it is good for some basic stuff like forms, cookies but it is still quite limited.
  3. You may use a full MVC web framework like CppCMS. But I would not recommend you to work in Windows environment for this purposes.
  4. You may also try Wt for "GUI-over-Web" development style.
不即不离 2024-08-11 17:41:45

您可能想查看像 cgicFastCGI,或 Wt > 而不是自己编写 CGI 代码。每个库都有一个非常易于使用的基本 API - 就像任何简单的库一样。

You might want to look at a library like cgic, FastCGI, or Wt instead of writing the CGI code on your own. Each of these libraries has a basic API that's very easy to use - just like any simple library.

深海里的那抹蓝 2024-08-11 17:41:45

如果您真的想这样做,那么我建议您查看 CppCMS ,一个C++ Web应用程序框架。如果您发现您确实不需要任何类型的框架,请查看 fastcgi.com。那里有一个 C 教程,您可以将所有 C 调用(主要是 IO)替换为 C++ std lib 调用。

If you are serious about wanting to do this, then I'd recommend looking at CppCMS, a C++ web application framework. If you find that you really don't want any kind of framework, then check out the documentation at fastcgi.com. There's a C tutorial there that you can just replace all the C calls (mostly IO) with C++ std lib calls.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文