spawn-fcgi的帮助信息可以通过manspawn-fcgi或spawn-fcgi–h获得,下面是部分常用spawn-fcgi参数信息。
spawn-fcgi参数信息:
Nginx与FastCGI
f指定调用FastCGI的进程的执行程序位置
-a绑定到地址addr。
-p绑定到端口port。
-s绑定到unixdomainsocket
-C指定产生的FastCGI的进程数,默认为5。(仅用于PHP)
-P指定产生的进程的PID文件路径。
-F指定产生的FastCGI的进程数(C的CGI用这个)
-u和-gFastCGI使用什么身份(-u用户-g用户组)运行,
CentOS下可以使用apache用户,其他的根据情况配置,如nobody、www-data等。
spawn-fcgifastgci应用程序
使用C/C++编写fastcgi应用程序,可以使用FastCGI软件开发套件或者其它开发框架,如
fastcgi++。
本文使用FastCGI软件开发套件——fcgi
0910052249.tar.gz.614929.html
通过此套件可以轻松编写fastcgi应用程序,安装fcgi:
./configue
make
如果编译出现类似以下错误:
6.3Nginx与FastCGI
94
cgio.cpp:Indestructor’virtualfcgi_streambuf::~fcgi_streambuf()’:
fcgio.cpp:50:error:’EOF’wasnotdeclaredinthisscope
fcgio.cpp:Inmemberfunction’virtualintfcgi_streambuf::overflow(int)’:
fcgio.cpp:70:error:’EOF’wasnotdeclaredinthisscope
fcgio.cpp:75:error:’EOF’wasnotdeclaredinthisscope
fcgio.cpp:Inmemberfunction’virtualintfcgi_streambuf::sync()’:
fcgio.cpp:86:error:’EOF’wasnotdeclaredinthisscope
fcgio.cpp:87:error:’EOF’wasnotdeclaredinthisscope
fcgio.cpp:Inmemberfunction’virtualintfcgi_streambuf::underflow()’:
fcgio.cpp:113:error:’EOF’wasnotdeclaredinthisscope
make[2]:*[fcgio.lo]Error1
make[2]:Leavingdirectory/root/downloads/fcgi-2.4.1-SNAP-0910052249/libfcgi'
make[1]:***[all-recursive]Error1
make[1]:Leavingdirectory/root/downloads/fcgi-2.4.1-SNAP-0910052249’
make:*[all]Error2
总之,spawn-fcgi给大家简单的介绍了一些,希望大家多看看。