how to install nginx with php ubuntu 20.04
sudo apt install php-fpm php-mysql
3.56
9
sudo chown -R $USER:$USER /var/www/your_domain
Thank you!
9
0
4
2
server {
listen 80;
server_name your_domain www.your_domain;
root /var/www/your_domain;
index index.html index.htm index.php;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
Thank you!
2
0
3
3
sudo nano /etc/nginx/sites-available/your_domain
Thank you!
3
0
3.33
6
sudo mkdir /var/www/your_domain
Thank you!
6
0
Are there any code examples left?
New code examples in category PHP