Solution for failure of running ThinkPhp in nginx

Source: Internet
Author: User
When setting up a collection program using the Thinkphp framework on the nginx server, ThinkPhp stops at the welcome page. after modification and debugging, it is found that, thinkPhp uses the path_info variable to build a collection program using the Thinkphp framework on the nginx server and stops ThinkPhp on the welcome page. after modification and debugging, it is found that ThinkPhp uses the path_info variable, this variable does not have a numeric value in nginx by default, so the nginx configuration is modified to achieve the goal. This situation has also been encountered before. Previously, we modified php and obtained another variable for analysis. It is difficult to modify the source code of ThinkPhp this time, so we have modified the nginx configuration.

Location ~ \. Php ($ | /){

# Omitted configuration

Set $ script $ uri;

Set $ path_info "/";

If ($ uri ~ "^ (. + \. Php) (/. + )")

{

Set $ script $1;

Set $ path_info $2;

}

Fastcgi_paramPATH_INFO $ path_info;

Fastcgi_paramSCRIPT_FILENAME $ document_root/$ script;

Fastcgi_paramSCRIPT_NAME $ script;

}

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.