Add fastcgi_paramSCRIPT_FILENAME $ document_root $ fastcgi_script_name on the Internet. The problem persists! Add by online
Fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name;
Still invalid. solve it!
Reply content:
Add by online
Fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name;
Still invalid. solve it!
I had a hard time tossing this problem yesterday. I was furious:
Check whether the following two lines exist in the/etc/nginx/fastcgi_params file.
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;fastcgi_param PATH_INFO $fastcgi_script_name;
Check your nginx error log. If the error 403 is reported:
Confirm the operating users of nginx and php-fpm
ps aux | grep nginx ps aux | grep php-fpm
If no www-data user is found in nginx, add the following code to the nginx configuration file and restart (/etc/nginx. conf)
user www-data www-data;
Open the/etc/php5/fpm/pool. d/www. conf file and remove the comments of the following three lines:
listen.owner = www-datalisten.group = www-datalisten.mode = 0660
This is all the problems I encountered. You can try it. In short, you should first read the log and then solve the problem according to the log. If the problem persists, you 'd better paste your log to see it.
Let's take a look at how php-fpm runs on your machine.
ss --unix --all | grep php
Modify the corresponding configuration file according to the output of the above commandserver {}
Infastcgi_pass
For more information, see nginx-ArchWiki.