1. Ubuntu Nginx, Php5 세팅해주는 과정에서 오류가 발생
$sudo nano /etc/nginx/sites-available/default
.
.
...
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
#
# # With php5-cgi alone:
fastcgi_pass 127.0.0.1:9000;
# # With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
이렇게 세팅을 해줬더니 502 Bad GateWay 오류가 났다.
로그를 찍어보니
$ nginx -t
nginx: [warn] server name "http://bobss.tk" has suspicious symbols in /etc/nginx/sites-enabled/default:28
nginx: [emerg] "fastcgi_pass" directive is duplicate in /etc/nginx/sites-enabled/default:58
nginx: configuration file /etc/nginx/nginx.conf test failed
default파일에서 오류가 발생해서 검색해보니
" The location block provided results in error: nginx: [emerg] unknown directive "fast_cgi_split_path_info" in /etc/nginx/sites-enabled/default:56 Need to remove the underscore between fast and cgi: fastcgi_split_path_info ^(.+\.php)(/.+)$; "
Then comment the first case with php5-cgi alone since php5-fpm is already installed.
I came with the same problem. Hope this could help you.
.
.
...
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
#
# # With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
php5-fpm와 cgi 가 중복된다는 뜻인것같아 주석처리후 재시작 했더니 해결
'공부 > Linux' 카테고리의 다른 글
LEMP스택 설치: NGINX 웹서버에 PHP 7 설치하기 및 설정 (PHP7.2-FPM) (0) | 2019.05.06 |
---|---|
PHP 5.3 ~ 7.2 + Nginx + MariaDB + 앱 자동 설치 (0) | 2018.02.18 |
php 파일업로드 크기 제한 설정 php.ini (nginx) (0) | 2016.02.14 |
php sendmail mail.. 작동.. (0) | 2015.12.16 |
Nginx 홈페이지 Rewrite (하드, 임시) (0) | 2015.11.15 |