Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用Lighthttpd配置和运行fastcgi应用程序 我安装了Windows的LythTPD,我在C++中创建了一个简单的程序,使用FASCGI库。我将在这里发布代码 #include "fcgi_stdio.h" #include <stdlib.h> int count; void initialize(void) { count=0; } void main(void) { initialize(); while (FCGI_Accept() >= 0) { printf("Content-type: text/html\r\n" "\r\n" "<title>FastCGI Hello! (C, fcgi_stdio library)</title>" "<h1>FastCGI Hello! (C, fcgi_stdio library)</h1>" "Request number %d running on host <i>%s</i>\n", ++count, getenv("SERVER_HOSTNAME")); } }_C++_Fastcgi_Lighttpd - Fatal编程技术网

如何使用Lighthttpd配置和运行fastcgi应用程序 我安装了Windows的LythTPD,我在C++中创建了一个简单的程序,使用FASCGI库。我将在这里发布代码 #include "fcgi_stdio.h" #include <stdlib.h> int count; void initialize(void) { count=0; } void main(void) { initialize(); while (FCGI_Accept() >= 0) { printf("Content-type: text/html\r\n" "\r\n" "<title>FastCGI Hello! (C, fcgi_stdio library)</title>" "<h1>FastCGI Hello! (C, fcgi_stdio library)</h1>" "Request number %d running on host <i>%s</i>\n", ++count, getenv("SERVER_HOSTNAME")); } }

如何使用Lighthttpd配置和运行fastcgi应用程序 我安装了Windows的LythTPD,我在C++中创建了一个简单的程序,使用FASCGI库。我将在这里发布代码 #include "fcgi_stdio.h" #include <stdlib.h> int count; void initialize(void) { count=0; } void main(void) { initialize(); while (FCGI_Accept() >= 0) { printf("Content-type: text/html\r\n" "\r\n" "<title>FastCGI Hello! (C, fcgi_stdio library)</title>" "<h1>FastCGI Hello! (C, fcgi_stdio library)</h1>" "Request number %d running on host <i>%s</i>\n", ++count, getenv("SERVER_HOSTNAME")); } },c++,fastcgi,lighttpd,C++,Fastcgi,Lighttpd,使用浏览器发送请求时,服务器在控制台中响应此消息 2009-02-18 16:08:34: (mod_fastcgi.c.2494) unexpected end-of-file (perhaps the fa stcgi process died): pid: 0 socket: tcp:localhost:8080 2009-02-18 16:08:34: (mod_fastcgi.c.3325) response not received, request sent: 1 024 on s

使用浏览器发送请求时,服务器在控制台中响应此消息

2009-02-18 16:08:34: (mod_fastcgi.c.2494) unexpected end-of-file (perhaps the fa
stcgi process died): pid: 0 socket: tcp:localhost:8080
2009-02-18 16:08:34: (mod_fastcgi.c.3325) response not received, request sent: 1
024 on socket: tcp:localhost:8080 for /new/tinycgi.exe , closing connection
我认为fastcgi应用程序没有正确生成

谢谢,,
Varun首先,main应该返回一个int(而不是void)。 问题很可能是您没有调用FCGX_Init(),也没有初始化请求(使用FCGX_InitRequest())


如果要检查应用程序是否正确生成,应写入日志文件,如果lighttpd未启动应用程序,则不会创建日志文件。

首先,main应返回int(而不是void)。 问题很可能是您没有调用FCGX_Init(),也没有初始化请求(使用FCGX_InitRequest())


如果要检查应用程序是否正确生成,则应写入日志文件,如果lighttpd未启动应用程序,不会创建日志文件。

您是否可以尝试使用和
标记重新格式化代码,因为它几乎不可能读取?您是否可以尝试使用和
标记重新格式化代码,因为它几乎不可能读取?
2009-02-18 16:08:34: (mod_fastcgi.c.2494) unexpected end-of-file (perhaps the fa
stcgi process died): pid: 0 socket: tcp:localhost:8080
2009-02-18 16:08:34: (mod_fastcgi.c.3325) response not received, request sent: 1
024 on socket: tcp:localhost:8080 for /new/tinycgi.exe , closing connection