標籤:
/*************************************************************************** * nginx php-cgi php * 說明: * 由於有需要多個web訪問的需求,於是選擇使用nginx來做連接埠映射,剛開始配置 * 的時候沒法先php還有fpm模式,因為交叉編譯php的時候只選擇cgi,所以配置的過程 * 中遇到問題,還有就是沒注意到要將php-cgi跑起來才行,之前通過busybox httpd是 * 不需要這麼做的。 * * 2016-9-26 深圳 南山平山村 曾劍鋒 **************************************************************************/一、參考文檔: 1. NGINX - No input file specified. - php Fast/CGI http://stackoverflow.com/questions/21377321/nginx-no-input-file-specified-php-fast-cgi 2. 解決NGINX PHP "No input file specified" http://xiahongyuan.blog.51cto.com/906214/852424 3. Nginx+php-cgi的配置方法介紹 http://blog.csdn.net/bookmoth/article/details/4568203 4. windows下配置nginx+php環境 http://www.cnblogs.com/huayangmeng/archive/2011/06/15/2081337.html二、修改nginx php配置: server { listen 80; server_name localhost; root /var/www/; index index.html index.htm index.php; # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; include fastcgi.conf; include fastcgi_params; } } 三、啟動php-cgi: 1. php-cgi -b 127.0.0.1:9000 -c /etc/php.ini 2. 開機自啟動: cat /etc/init.d/S51phpCGI echo "Start php-cgi." php-cgi -b 127.0.0.1:9000 -c /etc/php.ini &
nginx php-cgi php