Home >Backend Development >PHP Tutorial >Running php program under nginx returns 200, but a blank page

Running php program under nginx returns 200, but a blank page

WBOY
WBOYOriginal
2016-07-25 09:03:411189browse
  1. location ~ .php$ {
  2. root html;
  3. fastcgi_pass 127.0.0.1:9000;
  4. fastcgi_index index.php;
  5. #fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
  6. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  7. include fastcgi_params;
  8. }
Copy the code

or add it to the fastcgi_params configuration file:

  1. # PHP only, required if PHP was built with --enable-force-cgi-redirect
  2. fastcgi_param REDIRECT_STATUS 200;
  3. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
Copy code

Restart nginx, that is The page can be displayed normally. Articles you may be interested in: Blank page problem occurs when fastcgi_param runs php under nginx Solution to the problem that nginx+php-fpm page displays blank About the organizational structure of nginx+php-fpm configuration file



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn