Cause
In the past two days, when building the virtual host, the environment is basically configured. There is no problem in accessing the HTML file, but there is a file not found error when accessing the PHP file
Solution
When there is a problem, first open the log to find the error message
FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream
Well, if you don’t understand it, you can go directly to Baidu, and then according to the various results of Baidu, the attempt is failed, such as this one
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
change to
SCRIPT_FILENAME $document_root$fastcgi_script_name;
But my nginx configuration file is already like this, and then I started to compare the nginx configuration of the server running normally with my current nginx configuration. After comparison, the two are the same, so the problem is not nginx
Then continue to search by chance, try all kinds of things, and finally find a solution
/etc/selinux/config mid
SELINUX=enforcing
to
SELINUX=disabled
If it hasn’t been solved, consider the issue of permissions
It’s over
If problems are not solved, they will come back again
<?php
echo 'How can't this input box be removed?';
Similar Posts:
- [Solved] Nginx-FastCGI-“Primary script unknown” while reading response header from upstream,
- Nginx+PHP FastCGI sent in stderr: “Primary script unknown” while reading response head…
- File not found error handling of nginx accessing PHP files, two cases
- PHP FPM and Nginx start normally, page 502 Error [How to Solve]
- Nginx Error: File not found [Use php-fpm to parse PHP]
- Fix Nginx 502 Error:upstream sent too big header while reading response header from upstream
- PHP nginx 504 gateway timeout gateway timeout error
- Wnmp environment configuration (Windows + nginx + MySQL + PHP)
- nginx connect() failed (111: Connection refused) while connecting to upstream
- The solution of nginx executing PHP, no input file specified