By newpay5168
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
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello,
There are a few things that I could suggest:
/var/www/your_domain/ folder is owned by the Nginx user. To do that first check what the Nginx user is:sudo ps aux | grep -i nginx
Then get the user and run this command:
chown -R THE_NGINX_USER:THE_NGINX_USER /var/www/your_domain
tail -100 /var/log/nginx/error.log
Feel free to share any errors here so that I could try to advise you further.
Hope that this helps! Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.