Nginx config PHP fastcgi cannot resolve the problem

Source: Internet
Author: User
Tags config php configuration php

Many friends in the first contact with Nginx, configuration php-fpm will encounter can not parse index.php page situation, make restless, thought clearly is according to the official documents why this situation occurs?


Usually we will configure as follows:

Location ~ \.php$ {Root/usr/share/nginx/html;fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;fastcgi_par Am script_filename/usr/share/nginx/html/$fastcgi _script_name;include fastcgi_params;}

Here is a script_filename variable, possibly for historical reasons fastcgi_params this file does not contain the variable, the definition of the change amount is actually in the fastcgi.conf file. So replace the include line with

Include fastcgi.conf;

Or simply comment out the Fastcgi_param line to resolve the problem.

This article is from the Linux OPS blog, so be sure to keep this source http://arm2012.blog.51cto.com/2418467/1977514

Nginx config PHP fastcgi cannot resolve the problem

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.