WAS/Nginx

nginx_1.2.6 + php_5.4.10

Lawmin 2012. 12. 30. 00:59

1. nginx conf 수정 (conf/nginx.conf)

...

# location 바깥쪽 (server) 로 빼주면 전역 변수처럼 $document_root 로 치환된다.

# location 안쪽에 root를 쓰면 그 block 안에서만 처리됨

root   d:/server/htdocs;

...

location / {

            index  index.html index.htm index.php;

        }

location ~ \.php$ {

            fastcgi_pass   127.0.0.1:9000;

            fastcgi_index  index.php;

            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;  # web root 경로

            include        fastcgi_params;

        }


2. php-cgi 서버를 띄워야 한다. 그렇지 않으면 hang 비슷한 증상이 나타남.

d:\server\php> php-cgi -b 127.0.0.1:9000


[TO-DO]

자동으로 띄우는 방법이 없는지?

ab -n 10000 -c 5 http://127.0.0.1:8090/index.php 하면 php-cgi 가 자꾸 죽는데 방법이 없는지?


* 참고

http://www.srirangan.net/2011-10-getting-nginx-php-5-3-to-work-properly

http://nginxlibrary.com/resolving-no-input-file-specified-error/