webapp:nginx:php_연동
차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판이전 판다음 판 | 이전 판 | ||
webapp:nginx:php_연동 [2018/07/04 11:16] – kieuns | webapp:nginx:php_연동 [2024/04/23 22:44] (현재) – 바깥 편집 127.0.0.1 | ||
---|---|---|---|
줄 1: | 줄 1: | ||
+ | {{htmlmetatags> | ||
+ | metatag-keywords=(nginx, | ||
+ | metatag-description=(nginx php 연동) | ||
+ | metatag-description=(no input file specified. nginx php) | ||
+ | }} | ||
+ | |||
+ | 관련 링크 | ||
+ | |||
+ | | [[os: | ||
+ | |||
+ | ====== Windows nginx와 php 연동 ====== | ||
+ | |||
+ | * php cgi를 띄우고 | ||
+ | * nginx에는 php가 들어오면 이쪽으로 되돌려주도록 설정해서 씁니다. | ||
+ | |||
+ | php측 | ||
+ | |||
+ | ^ PHP 설치 폴더 | ||
+ | | < | ||
+ | | 포트는 (9123) 임의 설정 | ||
+ | |||
+ | |||
+ | nginx 측 | ||
+ | |||
+ | ^ nginx 설치폴더/ | ||
+ | | < | ||
+ | http { | ||
+ | | ||
+ | # | ||
+ | # .. 원래 있던 여러 항목들 .. | ||
+ | # | ||
+ | | ||
+ | server { | ||
+ | # pass the PHP scripts to FastCGI server listening on 127.0.0.1: | ||
+ | # | ||
+ | location ~ \.php$ { | ||
+ | fastcgi_pass | ||
+ | fastcgi_index | ||
+ | | ||
+ | # SCRIPT_FILENAME 이 잘못되어 있으면 오류남 | ||
+ | fastcgi_param | ||
+ | | ||
+ | include | ||
+ | } | ||
+ | |||
+ | # | ||
+ | # .. 그외 원래 있던 것들 .. | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ===== no input file specified ===== | ||
+ | |||
+ | no input file specified. | ||
+ | |||
+ | 위의 에러가 뜰때는, | ||
+ | |||
+ | fastcgi_param | ||
+ | |||
+ | 파일을 못찾아서 나는 에러니, | ||
+ | |||
+ | fastcgi_param 부분에서 **$document_root** 로 시작하는지 확인합니다. | ||
+ | |||
+ | {{tag> | ||
+ | |||
+ | ====== 디렉토리 리스팅 켜기 ====== | ||
+ | |||
+ | **nginx.conf** 파일을 수정한다. | ||
+ | |||
+ | 수정할 부분은 **http {** ... **server {** .. 안쪽에 | ||
+ | |||
+ | autoindex on; | ||
+ | |||
+ | 추가한다. | ||
+ | |||
+ | ^ 예시 ^ | ||
+ | | < | ||
+ | http { | ||
+ | server { | ||
+ | # | ||
+ | # .. 그외 원래 있던 것들 .. | ||
+ | # | ||
+ | autoindex on; | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | {{tag> |