After installing PHP-FPM in Ngxin, the HTML static page is no problem, however, although the Phpinfo page returns 200 status code, the browsing is always blank and there is no error.
Consider should be Nginx has moved the PHP page to PHP processing, so the problem should be in the configuration of PHP, after searching, found that need to add a sentence in Nginx:
Fastcgi_param script_filename $document _root$fastcgi_script_name;
After installing Nginx, the default fastcgi_params configuration file does not have the above sentence.
In the nginx.conf
Copy the Code code as follows:
Location ~. php$ {
root HTML;
Fastcgi_pass 127.0.0.1:9000;
Fastcgi_index index.php;
#fastcgi_param Script_filename/scripts$fastcgi_script_name;
Fastcgi_param script_filename $document _root$fastcgi_script_name;
Include Fastcgi_params;
}
Or include in the Fastcgi_params configuration file:
Copy the Code code as follows:
# PHP only, required if PHP is built with--enable-force-cgi-redirect
Fastcgi_param Redirect_status 200;
Fastcgi_param script_filename $document _root$fastcgi_script_name;
Restart Nginx to display the page normally.
This article is from the "Savage Power" blog, please be sure to keep this source http://chenfei123.blog.51cto.com/1427669/1703224
Nginx Run PHP program when the return 200 access is a blank page problem resolution