File not found NGINX

One website that is hosted on a server I recently increased php to 7.2, If I had known the issues this would cause I might have not started but hey ho!

So I have 3 sites sharing this VPS. The other 2 are working fine. And the one that was not working momentarily appeared to be working as I saw all the warning all the sites gave me as php broke the old php code (was not 7.2 compatible).

For some reason however I get simple file not found message on the screen. So searching yesterday I found some posts but most all were nothing useful. I think I have checked the correct user. Will php user be changed somehow?

So I also get this for the sitemap.xml file so it’s not looking related to the php for me…

My server block for the php is

location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/run/php/php7.2-fpm.sock;

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi @landed,

The Not Found message shouldn’t be connected to the PHP. Usually a 404 error is a result of not using the proper location for your website files.

Now I didn’t fully understand if you get 404 Not Found as a server error code or from your application. If it’s from your application, I’ll recommend checking your error log /var/log/nginx/error.log.

Additionally, please confirm PHP is actually in the mentioned directories fastcgi_pass unix:/run/php/php7.2-fpm.sock;. To do so type in

whereis php

Once you find it, replace the path in your location block with the one you have now.

Regards, KDSys