[PHP] [Nginx PHP-FPM] 페이지 access denied. 뜨는 현상 (see security.limit_extensions) - php7 버젼
개발 구축 후 index.html 파일에 access denied가 뜨는 현상이 발생
에러로그를 보자.
# cd /var/log/nginx
# vi error.log
2018/02/07 22:14:37 [error] 5503#5503: *1 FastCGI sent in stderr: "Access to the script '/usr/share/nginx/html' has been denied (see security.limit_extensions)" while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.2-fpm.sock:", host: "127.0.0.1"
security.limit_extensions가 눈에 띈다.
-첫번쨰 해결방법
검색해보니 보통 이 문제가 많은듯하다.
# cd /etc/php/7.2/fpm/pool.d/
# sudo vi www.conf
style="outline: none; color: rgb(102, 102, 102); font-family: "Noto Sans", sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);">
여기에 해당 옵션이 있다.
;security.limit_extensions =
security.limit_extensions = .php .html .htm .php3 .php4 .php5 .php7
으로 변경한다.
빈칸은 모두다 허용이고 확장자를 써넣을 경우 적혀있는 확장자만 허용을 할 수 있게 하는 옵션이다.