[리눅스팁] NGINX PHP-FPM 업데이트 및 여러 버전 동시 연동 방법
2020.05.02 05:33
0
https://eond.com/432253

https://extrememanual.net/10557

NGINX 설정 예시

1. abc.com 가상 호스트

server {
     listen 80;
     server_name abc.com;
     location ~ \.php$ {
          include snippets/fastcgi-php.conf;
          fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
     }
}

2. xyz.com 가상 호스트

server {
     listen 80;
     server_name xyz.com;
     location ~ \.php$ {
          include snippets/fastcgi-php.conf;
          fastcgi_pass unix:/var/run/php/php5.6-fpm.sock;
     }
}

가상 호스트 설정 구문에서 PHP 확장자를 컨트롤하는 location 구문에서 fastcgi_pass 경로를 원하는 버전의 소켓과 연결합니다.

사이트별로 다른 PHP 버전을 구동하고 싶은 경우 각 가상 호스트 설정의 위와 같이 원하는 버전으로 소켓을 설정하면 되겠습니다.


참조

https://idchowto.com/?p=44943

https://guides.wp-bullet.com/install-php-7-4-fpm-on-ubuntu-18-04/


라이믹스는 이온디와 함께

닫기

마이페이지

로그인을 해주세요