{{htmlmetatags>metatag-robots=()
metatag-keywords=(nginx,php,연동,nginx php 연동,디렉토리)
metatag-description=(nginx php 연동)
metatag-description=(no input file specified. nginx php)
}}
관련 링크
| [[os:osx:웹서버-설정|OSX 웹서버 설정]] |
====== Windows nginx와 php 연동 ======
* php cgi를 띄우고
* nginx에는 php가 들어오면 이쪽으로 되돌려주도록 설정해서 씁니다.
php측
^ PHP 설치 폴더 ^
| php-cgi.exe -b 127.0.0.1:9123
|
| 포트는 (9123) 임의 설정 |
nginx 측
^ nginx 설치폴더/conf/nginx.conf ^
|
http {
#
# .. 원래 있던 여러 항목들 ..
#
server {
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9123;
fastcgi_index index.php;
# SCRIPT_FILENAME 이 잘못되어 있으면 오류남
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
#
# .. 그외 원래 있던 것들 ..
}
}
|
===== no input file specified =====
no input file specified.
위의 에러가 뜰때는,
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
파일을 못찾아서 나는 에러니,
fastcgi_param 부분에서 **$document_root** 로 시작하는지 확인합니다.
{{tag>php nginx 연동}}
====== 디렉토리 리스팅 켜기 ======
**nginx.conf** 파일을 수정한다.
수정할 부분은 **http {** ... **server {** .. 안쪽에
autoindex on;
추가한다.
^ 예시 ^
|
http {
server {
#
# .. 그외 원래 있던 것들 ..
#
autoindex on;
}
}
|
{{tag>nginx 디렉토리 디렉토리_리스팅}}