3
Windows에 LightTPD를 설치했습니다. fastcgi없이 정상적으로 시작됩니다.fastcgi로 Lighthttpd를 구성하는 방법
server.modules = (
...
"mod_fastcgi",
....
fastcgi.server = (".exe" =>
("" =>
("bin-path" => "C:\FastCGI\Examples\C++\Ex_Counter.exe",
"port" => 8080,
"min-procs" => 1,
"max-procs" => 1
)
)
)
그리고 시작에 오류 얻을 :
C:\LightTPD>LightTPD.exe -f conf\lighttpd-inc.conf -m lib -D
cygwin warning:
MS-DOS style path detected: conf\lighttpd-inc.conf
Preferred POSIX equivalent is: conf/lighttpd-inc.conf
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
2011-10-07 12:50:25: (log.c.166) server started
2011-10-07 12:50:25: (mod_fastcgi.c.1367) --- fastcgi spawning local
proc: C:\FastCGI\Examples\C++\Ex_Counter.exe
port: 8080
socket
max-procs: 1
2011-10-07 12:50:25: (mod_fastcgi.c.1391) --- fastcgi spawning
port: 8080
socket
current: 0/1
2011-10-07 12:50:25: (mod_fastcgi.c.1104) the fastcgi-backend C:\FastCGI\Example
s\C++\Ex_Counter.exe failed to start:
2011-10-07 12:50:25: (mod_fastcgi.c.1108) child exited with status 0 C:\FastCGI\
Examples\C++\Ex_Counter.exe
2011-10-07 12:50:25: (mod_fastcgi.c.1111) If you're trying to run your app as a
FastCGI backend, make sure you're using the FastCGI-enabled version.
If this is PHP on Gentoo, add 'fastcgi' to the USE flags.
2011-10-07 12:50:25: (mod_fastcgi.c.1399) [ERROR]: spawning fcgi failed.
2011-10-07 12:50:25: (server.c.942) Configuration of plugins failed. Going down.
나 '를 은 그 때 나는 /이 된 FastCGI 예
#include <sstream> // manipulate strings (integer conversion)
#include <string> // work with strings in a more intuitive way
#include "libfcgi2.h" // Header file for libfcgi2.dll (linked with libfcgi2.lib)
using namespace std;
int main()
{
printf("Start...\r\n");
FCGX_REQUEST Req = { 0 }; // Create & Initialize all members to zero
int count(0);
string sReply;
ostringstream ss;
FCGX_InitRequest(&Req, 0, 0); // FCGX_DEBUG - third parameter
// Open Database
while(true)
{
if(FCGX_Accept_r(&Req) < 0) break; // Execution is blocked here until a Request is received
count++;
ss << count; // Stringstream is a typesafe Integer conversion
sReply = "Content-Type: text/html\r\n\r\n Hello World " + ss.str();
FCGX_PutStr(sReply.data(), sReply.length(), Req.pOut);
ss.str(""); // clear the string stream object
}
// Close Database
printf("End...\r\n");
return 0;
}
하고 다음과 같은 설정으로 서버를 시작하려고 노력 중 하나 붙여 복사 PHP를 사용하지 않으므로이 플래그를 어디에 설정해야할지 모르겠다.
을하지만 libfcgi2.h – Ivan
@Ivan에는 FCGX_Init이()이없는, 흠 난을 참조하십시오. www.coastrd.com에서 해당 출처의 스핀을 사용하고 있습니까? libfcgi2.h 파일을 살펴보면 FCXG_Init()이 먼저 호출되어야한다는 매우 유사한 주석이 표시됩니다. 그들은 그 함수를 선언하지 않았기 때문에 미묘한 버그 나 예를 업데이트하지 않은 다른 전제 조건이 있다고 의심됩니다. 나는 그 예를 직접 그들과 접촉 할 것이다. 내가 아는 fastcgi2의 기본 소스는 http://www.fastcgi.com/drupal/node/5에 있으며,이 회사는 자신의 버전을 마이그레이션 한 곳이라고 생각합니다. – James
http://www.fastcgi.com/dist/fcgi.tar.gz 에서 다른 라이브러리를 사용해보십시오. "Visual Studio Command Prompt (2010)"에서 다운로드했습니다. nmake -f Makefile.nt fcgi-2.4.0 \ libfcgi \ Release \ libfcgi.dll을 fcgi-2.4.0 \ examples \ echo \ cpp \ Release \ libfcgi.dll에 복사하십시오. 다음과 같이 lightttpd 구성을 사용하십시오 : "bin-path"=> C : \ Downloads \ fcgi-2.4.0 \ examples \ echo \ cpp \ Release \ echo-cpp.exe " – Ivan