Nginx PHP returns 200, but a blank page

Source: Internet
Author: User
Tags blank page

NGXIN;PHP-FPM after installation, HTML static page is no problem, but Phpinfo page returns 200, but always blank page

There is no error, consider should be nginx PHP page has been transferred to the PHP processing, so the problem should be in the configuration of PHP, after looking, found that the need to add a word in Nginx
Fastcgi_param script_filename $document _root$fastcgi_script_name;

The default Fastcgi_params configuration file does not have the above sentence after installing Nginx.

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
# php only in the Fastcgi_params configuration file, required if PHP is built with--enable-forCe-cgi-redirect
fastcgi_param  redirect_status   
fastcgi_param  SCRIPT_ FILENAME $document _root$fastcgi_script_name;

And then restart Nginx to display the 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.