설치환경
Raspberry pi 4B
Bullseye 64bit
nginx와 php, php-fpm 설치
1 2 3 |
$ sudo apt-get install nginx $ sudo apt-get php7.4 php7.4-fpm $ |
php-fpm 모듈과 같이 apache도 동시에 설치가 되기 때문에 apache관련 데몬은 비활성화를 해준다.
1 2 3 |
$ sudo systemctl stop apache2.service $ sudo systemctl disable apache2.service $ |
nginx와 php연동을 위한 설정
1 2 3 4 5 6 7 8 9 10 11 12 13 |
$ sudo vi /etc/nginx/sites-enabled/default # Add index.php to the list if you are using PHP index index.php index.html index.htm index.nginx-debian.html; ~~~ location ~ \.php$ { include snippets/fastcgi-php.conf; # # # With php-fpm (or other unix sockets): fastcgi_pass unix:/run/php/php7.4-fpm.sock; # # With php-cgi (or other tcp sockets): # fastcgi_pass 127.0.0.1:9000; } $ |
nginx 재기동
1 2 |
$ sudo systemctl restart nginx.service $ |