web(五)---spawn-fastcgi
一. spawn_fastcgi的安装、部署与配置.
fcgio.cpp: In destructor ‘virtual fcgi_streambuf::~fcgi_streambuf()‘:
fcgio.cpp:50:14: error: ‘EOF‘ was not declared in this scope
fcgio.cpp: In member function ‘virtual int fcgi_streambuf::overflow(int)‘:
fcgio.cpp:70:72: error: ‘EOF‘ was not declared in this scope
fcgio.cpp:75:14: error: ‘EOF‘ was not declared in this scope
fcgio.cpp: In member function ‘virtual int fcgi_streambuf::sync()‘:
fcgio.cpp:86:18: error: ‘EOF‘ was not declared in this scope
fcgio.cpp:87:41: error: ‘EOF‘ was not declared in this scope
fcgio.cpp: In member function ‘virtual int fcgi_streambuf::underflow()‘:
fcgio.cpp:113:35: error: ‘EOF‘ was not declared in this scope
make[2]: *** [fcgio.lo] Error 1
make[2]: Leaving directory `/home/lucasysfeng/workspace/web/download/nginx_spawn_fcgi_install_package/fcgi-2.4.1-SNAP-0311112127/libfcgi‘
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/lucasysfeng/workspace/web/download/nginx_spawn_fcgi_install_package/fcgi-2.4.1-SNAP-0311112127‘
make: *** [all] Error 2
#include <fcgi_stdio.h> #include <stdlib.h> #include <unistd.h> int main() { int count = 0; while (FCGI_Accept() >= 0) { printf("Content-type: text/html\r\n" "\r\n" "" "FastCGI Hello!" "Request number %d running on host%s " "Process ID: %d\n", ++count, getenv("SERVER_NAME"), getpid()); } return 0; }
2. 编译.
g++ demo.cc -o demo -lfcgi?
fastcgi_pass 127.0.0.1:8088;
fastcgi_index index.cgi;
fastcgi_param SCRIPT_FILENAME fcgi$fastcgi_script_name;
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。