Nginx FastCGI error primary script unknown Solution

Source: Internet
Author: User
After nginx 1.4 and PHP 5.4 are compiled and installed on centos and nginx and PHP-FPM are started successfully, the "file not found" prompt is displayed when you access PHP. "At the same time, you can see in the error log: copy the Code as follows: 20:05:49 [Error] 12691 #0: * 6 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 192.168.168.1, server: localhost, request: "Get/HTTP/1.1", upstream: "FastCGI: // 127.0.0.1: 9000 ", host:" 192.168.168.20." error solution: In the nginx configuration file, locate the location where the script file is called, for example, copy the code. The Code is as follows: fastcgi_param script_filename/scripts $ fastcgi_script_name; change to the following method ($ document_root): copy the Code as follows: fastcgi_param script_filename $ document_root $ fastcgi_script_name: $ document_root indicates the value specified by the current request in the root command. For example, the copy code is as follows: Location/{root/usr/local/nginx/html; Index. PHP index.html index.htm; fastcgi_param script_filename $ document_root $ fastcgi_script_name;} in the above configuration, $ document_root resolves PHP files under the/usr/local/nginx/html directory.

 

Nginx FastCGI error primary script unknown Solution

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.