Nginx report File not found error

Source: Internet
Author: User

There may be many reasons for this, but for beginners. Most should be/etc/nginx/conf.d/default.conf inside the PHP parsing part of the configuration is incorrect.

The solution is to define the root and add it under server so that the scope of root is expanded. Remove the root from the location ~ \.php${. Fastcgi_param section changed to $document_root$fastcgi_script_name;


Well, let's summarize the reasons for this kind of error:

1. One of the possible reasons: the/etc/nginx/conf.d/default.conf root path and the PHP parsing section are not configured.

Workaround: Place the root definition under Server, or the root definition in the PHP parsing section as the full path. At the same time, the Fastcgi_param part is changed to $document_root$fastcgi_script_name;


2. Two possible reasons: the requested file (for example: xxx.php) file does not really exist the path corresponding to the URL.

Resolution: Locate the relevant file and confirm the path.


3. Three possible reasons: the path does not have read permissions.

FIX: Add users and Permissions.


4. Off-topic, if no PHP parsing is turned on. Then the PHP file is downloaded as a file and is not parsed.


Reference links and articles are as follows:

Http://www.2cto.com/os/201212/178528.html

Http://www.cnblogs.com/iosdev/p/3439834.html

Http://blog.chinaunix.net/uid-26719405-id-3586780.html

Http://www.trackself.com/archives/2443.html


Nginx report File not found error

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.