본문 바로가기

WEB/Nginx

nginx + php 에러 상황

2021/06/05 19:59:52 [crit] 8521#0: *1 connect() to unix:/var/run/php5-fpm.sock failed (13: Permission denied) while connecting to upstream, client: 192.168.0.3, server: localhost, request: "GET /hello.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "192.168.0.2:7000"

user, group 설정 에러
-> /etc/php-fpm.d/www.conf
-> nginx 를 기동하는 유저 그룹명을 적어야 함

user = nginx
group = nginx

블로그 참고 : https://jootc.com/p/201810272135

 


 

2021/06/05 20:17:39 [error] 13979#0: *1 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 192.168.0.3, server: localhost, request: "GET /hello.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "192.168.0.2:7000"

경로 설정 에러

/etc/php-fpm.d/www.conf 의 chdir 경로와

nginx.conf 의 root 경로가 서로 달라서 발생하는 문제

아래와 같이 설정하여 해결하였다.

 

(/etc/php-fpm.d/www.conf)

 

(nginx.conf)

 

'WEB > Nginx' 카테고리의 다른 글

yum install nginx  (0) 2021.06.05
PHP 7.4 설치 가이드 (NginX + PHP 환경)  (0) 2021.06.05
Nginx 설치 - 소스 컴파일 방식  (0) 2021.04.22