我已经将 Web 服务器配置为通过命名管道使用“远程”fastCGI 应用程序(它实际上位于同一台 Windows 主机上)。我现在正试图找出如何启动 fastCGI 应用程序以使用此管道,但我不确定应该如何完成。其他操作系统似乎有用于执行此操作的 spawn-fcgi 实用程序,但 Windows 似乎没有任何类似的东西。
这是我的APP:
#include <stdio.h>
#include "fcgi_stdio.h"
int main(int argc, char ** argv)
{
while (FCGI_Accept() >= 0) {
printf("Content-type: text/html\r\n"
"\r\n"
"<title>Web Services Interface Module</title>"
"<h1>Web Services Interface Module</h1>\n");
}
return(0);
}
出于兴趣,我正在使用 Abyss Web Server,但我希望这不会影响答案。
最好的问候
最佳答案
FCGI 接口(interface)不允许你这样做,而是使用 FCGX 接口(interface)。 调用 FCGX_Open_Socket 以监听特定端口,例如9345 或命名管道。
FCGX_OpenSocket(":9345", 500);
那么您根本不需要使用像 spawn_fcgi 这样的实用程序来启动您的应用程序。
关于fastcgi - 如何在 Windows 上手动启动 fastCGI 应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1945293/