如何通过CGI接口调用我的C ++二进制? [英] How do I invoke my C++ binaries via the CGI interface?

查看:106
本文介绍了如何通过CGI接口调用我的C ++二进制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想一个PHP的解决方案转换为C ++的解决方案。目前,我有我的服务器端用PHP写的 - 没有太多code,下千行。这样我就可以,没有问题重写 - 我不需要用嘻哈或类似的自动化

I'd like to convert a PHP solution to a C++ solution. Currently I have my server-side written in PHP - not too much code, under a thousand lines. So I can rewrite it with no problem - I don't need to use hip-hop or similar automations.

现在的问题是如何安装/配置正确的软件来支持C ++ code在服务器端。我不知道如何通过CGI web服务器调用二进制文件。

The question is how do I install/configure the correct software to support C++ code on the server side. I do not know how to invoke binaries by the web server via CGI.

PHP是容易的,安装XAMPP或类似的写PHP和你是pretty多了去。

PHP is easy, install XAMPP or similar write the PHP and you are pretty much up and going.

不过,我想运行C ++。

However, I want to run C++.

感谢

推荐答案

三个基本选项:


  • 请整个事情在C ++中,让你的程序一个独立的Web服务器(可能通过Apache代理到提供的东西如SSL,静态的媒体,认证等)

  • 在一个cgi-bin目录运行C ++,通过Apache

  • 请一个PHP包装器,弹到C ++的部分(这是一个不错的选择,如果性能关键的部分是小的,因为你仍然可以使用安慰的是,PHP的垃圾收集和字符串操作给你)

这篇关于如何通过CGI接口调用我的C ++二进制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆