1, PHP.ini (/usr/local/php/etc/php.ini) in the configuration found in
Cgi.fix_pathinfo=0
Change it to
Cgi.fix_pathinfo=1
2, nginx configuration file/etc/nginx/conf/nginx.conf Note the following sections
The code is as follows |
|
Location ~. php$ { Fastcgi_pass 127.0.0.1:9000; Fastcgi_index index.php; Fastcgi_param Script_filename/home/www/blog$fastcgi_script_name; Include Fastcgi_params; } |
The red part path needs to be filled out according to the actual situation of your host directory
After configuring the above section, restart the Nginx and PHP-FPM, the problem is successful
In addition, it may be related to the path or permissions, or the Script_filename variable is not set correctly (this is the most common reason for nginx)
1 if there are 404 errors in HTML, then there is a problem with the document root setting
2 Check script file permissions, maybe php or Web server can not read it
3) Script_filename Set error
Workaround:
Script_filename settings are excluded, the problem appears on the Directory folder and file permission access. The permissions of the file WWW user group have been reset, and the background can be accessed immediately. Here again special thanks for long cool child shoes.
The SSH command to set permissions is
The code is as follows |
|
CHOWN-VR Www:www/folder |
Add: My Script_filename set the parameters
Vim fcgi.conf (Script_filename directory)
The code is as follows |
|
Fastcgi_param script_filename $document _root$fastcgi_script_name; Fastcgi_param script_name $fastcgi _script_name; Fastcgi_param Request_uri $request _uri; Fastcgi_param Document_uri $document _uri; Fastcgi_param document_root $document _root; Fastcgi_param server_protocol $server _protocol; |
The permissions corresponding to the Document_root must be the same as the nginx.conf and fcgi.conf users