sudo apt install nginx php-fpm libnginx-mod-rtmp apache2-utils
$sudo nano /etc/nginx/sites-available/default
$sudo nano /etc/nginx/sites-available/default
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html index.php;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# # With php-fpm (or other unix sockets):
fastcgi_pass unix:/run/php/php-fpm.sock;
# # With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
}$sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
sudo systemctl restart nginx
$nano /var/www/html/info.php
<?php phpinfo(); ?>

コメント