工具下载地址: http://www.fastcgi.com/dist/fcgi.tar.gz
工具使用文档: http://www.fastcgi.com/devkit/doc/fcgi-devel-kit.htm
命令:
1 2 3 4 5 6 7 8 9 10 11 12 |
#启动一个fcgi server,其中aUnixSocket是一个unix socket root@phpor-Latitude-E5410:~/Program/fcgi-2.4.1-SNAP-0311112127/examples# ../cgi-fcgi/cgi-fcgi -start -connect aUnixSocket authorizer #另一个terminal, 导出的这两个环境变量是程序 authorizer 中写死的 root@phpor-Latitude-E5410:~/Program/fcgi-2.4.1-SNAP-0311112127/examples# export REMOTE_USER=$USER REMOTE_PASSWD=xxxx #发起一个fcgi请求 root@phpor-Latitude-E5410:~/Program/fcgi-2.4.1-SNAP-0311112127/examples# ../cgi-fcgi/cgi-fcgi -bind -connect aUnixSocket Status: 200 OK Variable-AUTH_TYPE: Basic Variable-REMOTE_PASSWD: Variable-PROCESS_ID: 0 |
命令: 连接一个真是存在的fcgi server
1 2 3 4 5 6 |
root@phpor-Latitude-E5410:~/Program/fcgi-2.4.1-SNAP-0311112127/examples# env -i SCRIPT_FILENAME=/home/phpor/www/a.php REQUEST_METHOD=GET ../cgi-fcgi/cgi-fcgi -bind -connect :9000 X-Powered-By: PHP/5.4.9-4ubuntu2.1 Content-type: text/html 01:22:34 root@phpor-Latitude-E5410:~/Program/fcgi-2.4.1-SNAP-0311112127/examples# |
这里只写了两个环境变量,不过,也至少要有这两个:
1 |
SCRIPT_FILENAME=/home/phpor/www/a.php |
1 |
REQUEST_METHOD=GET |