如何配置执行c写的cgi程序
来源:互联网 发布:linux创建txt文件命令 编辑:程序博客网 时间:2024/04/30 04:21
apache配置如下:
ScriptAlias /cgi-bin/ "C:/Apache2/cgi-bin/"
#
# "C:/Apache2/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "C:/Apache2/cgi-bin" >
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory >
test.c代码如下:
#include <stdio.h >
#include <stdlib.h >
int main(void)
{
char* query;
printf("%s%c%c/n","Content-Type:text/html;charset=iso-8859-1",13,10);
printf(" <title >Search Result </title >/n");
printf(" <H3 >Search Result </H3 >/n");
query = getenv("QUERY_STRING");
// Note 1: other functions to truncate the query string
// Note 2: other functions to search for the related documents
// Now, if you find the word and want to display on user "s browser, do
printf("/n <p > word %s is found/n", query);
}
我用MinGW编译程序,把程序放到了
C:/Apache2/cgi-bin/test.exe
但用IE打开:http://localhost/cgi-bin/test.exe
确要我下载.问题出在哪呢?
请各位高手帮忙. 20
AllowOverride All
Options All
Order allow,deny
Allow from all
</Directory >
我是在windows平台下做测试的.
ScriptAlias /cgi-bin/ "C:/Apache2/cgi-bin/"
#
# "C:/Apache2/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "C:/Apache2/cgi-bin" >
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory >
test.c代码如下:
#include <stdio.h >
#include <stdlib.h >
int main(void)
{
char* query;
printf("%s%c%c/n","Content-Type:text/html;charset=iso-8859-1",13,10);
printf(" <title >Search Result </title >/n");
printf(" <H3 >Search Result </H3 >/n");
query = getenv("QUERY_STRING");
// Note 1: other functions to truncate the query string
// Note 2: other functions to search for the related documents
// Now, if you find the word and want to display on user "s browser, do
printf("/n <p > word %s is found/n", query);
}
我用MinGW编译程序,把程序放到了
C:/Apache2/cgi-bin/test.exe
但用IE打开:http://localhost/cgi-bin/test.exe
确要我下载.问题出在哪呢?
请各位高手帮忙. 20
- xing007008
- 等 级:
- tipboy
- 等 级:
- mocom
- 等 级:
AllowOverride All
Options All
Order allow,deny
Allow from all
</Directory >
- xing007008
- 等 级:
我是在windows平台下做测试的.
- netxuning
- 等 级:
- hij333
- 等 级:
- 如何配置执行c写的cgi程序
- 用c写cgi程序,不能在cgi程序中执行shell命令
- nginx配置spawn-fastcgi执行自己编写的CGI程序(c/c++)
- 在c语言写的cgi程序中如何获取URL传递的参数
- C语言写CGI程序
- C语言写CGI程序
- C语言写CGI程序
- C语言写CGI程序
- 用C或C++写CGI程序的简要指南
- lighttpd + CGI,用c语言写cgi程序
- CGI简介&用C来写CGI程序简要指南
- [转]用 C/C++ 写 CGI 程序
- 用C写CGI程序简要指南
- 用 C/C++ 写 CGI 程序
- 用 c 写 CGI 程序简要指南
- 用c写CGI 程序简要指南
- 用C写CGI程序简要指南
- C语言写CGI程序【转】
- Tomcat服务器下如何配置并使用可执行CGI,扩屏名是exe的。
- dbgrid中加入COMBOBOX
- DBGrid 应用全书
- 对水波特效实现原理的解释
- 好想快点毕业带父母去旅游一下
- 如何配置执行c写的cgi程序
- 十五天的假期-7
- AJAX ControlToolkit 系列之---CollapsiblePanelExtender
- 配置Apache服务器
- JavaScript的学习笔记-1
- ERP是什么(例子说明)
- Axis开发Web Service实例
- Tomcat全攻略
- 第三次作业