Skip to content
Advertisement

Nginx not finding PHP files

I’ve been searching through all the questions asked and all answers haven’t worked. I’m trying to install Damn Vulnerable Web App to my Centos 6.9 server, but when I try to access the page, I’m greeted with a 404 File Not Found error. I can access html files perfectly, just not PHP.

/etc/nginx/conf.d/default.conf:

JavaScript

Can anyone help at all please?

UPDATE: After multiple attempts, below are the updated files. Now getting a ‘File Not Found’ even though the files reside within the root directory stated in the default.conf file.

/etc/nginx/conf.d/default.conf:

JavaScript

}

/etc/nginx/fastcgi_params:

JavaScript

The changes seen in other questions haven’t had any positive effect.

THIS HAS BEEN SOLVED. The location in default.conf was pointing to ‘html’ where it should have been ‘/usr/share/nginx/html’.

Advertisement

Answer

THIS HAS BEEN SOLVED. The ‘root’ in default.conf/location ~ .php$ was pointing to ‘html’ where it should have been ‘/usr/share/nginx/html’.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement