NginxPHP returns 200, but the blank page _ PHP Tutorial

Source: Internet
Author: User
Tags blank page
NginxPHP returns 200, but a blank page is displayed. After ngxin; php-fpm is installed, there is no problem with html static pages. However, although the phpinfo page returns 200, no error is reported for blank pages, it should be considered that nginx has transferred the php page to ngxin; after php-fpm is installed, there is no problem with the html static page, but although the phpinfo page returns 200, it is always a blank page

No error is reported. it should be considered that nginx has transferred the php page to php for processing. Therefore, the problem should be found in the php configuration and a sentence should be added to nginx.
Fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name;

After nginx is installed, the default fastcgi_params configuration file does not contain the above sentence.

In nginx. conf
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 add it to the fastcgi_params configuration file.
# PHP only, required if PHP was 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.

Ingress does not report any error. it should be considered that nginx has transferred the php page...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.