Nginx access PHP file error file not found
reason
This error is very common. There are two kinds of errors
- PHP FPM cannot find script_ PHP file executed in filename
- PHP FPM cannot access the executed PHP, which is a permission problem
solve
Is your PHP project file in your nginx default root directory, so change the configuration file nginx.conf
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
Replace with the following
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
$document_ Root represents the value specified in the root directive for the current request
Then reload the nginx configuration file
nginx -s reload