Question
Step 5 — Creating a PHP File to Test Configuration, Show 404 Not Found
How To Install Linux, Nginx, MariaDB, PHP (LEMP stack) on Debian 10_
https://www.digitalocean.com/community/questions/new?tags=LEMP%2CNginx%2CDebian+10
Above is OK.
Step 4 — Configuring Nginx to Use the PHP Processor
My_domain is “newpay191217.ml”
$ sudo mkdir /var/www/newpay191217.ml
$ sudo chown -R $USER:$USER /var/www/newpay191217.ml
$ sudo nano /etc/nginx/sites-available/newpay191217.ml
server {
listen 80;
listen [::]:80;
root /var/www/newpay191217.ml;
index index.php index.html index.htm;
server_name newpay191217.ml www.newpay191217.ml;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
}
}
$ sudo ln -s /etc/nginx/sites-available/newpay191217.ml /etc/nginx/sites-enabled/
$ sudo nginx -t
$ sudo systemctl reload nginx
Step 5 — Creating a PHP File to Test Configuration, Show 404 Not Found
$ nano /var/www/your_domain/info.php
<?php
phpinfo();
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
.....
http://www.newpay191217.ml/info.php
404 Not Found
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×