Lnmp built, nginx under PHP file 404 but html file normal access "resolved"

Source: Internet
Author: User

Today, I have a title problem.

Got a lot of information on the Internet.

I finally found a way to solve my problem in this link.

https://stackoverflow.com/questions/23443398/nginx-error-connect-to-php5-fpm-sock-failed-13-permission-denied/23596317

This is a problem that may not be the case for everyone.

I summed up the following two points, can be in these two directions to solve the problem:

1. In the nginx.conf file, the root command and the Fastcgi_param command are consistent with the path to the file you want to access.

2. Is the issue of permissions.

Can be viewed through Nginx's Error.log,

  

Connect () to UNIX:/RUN/PHP/PHP5. 6-fpm.sock failed (: Permission denied)

If you have the above error message, the description is Php-fpm.sock permissions issue.

You can view the owning group and the owning user of php-fpm through the php-fpm www.conf file.

user=www-Data//This is the owning usergroup =www-data//This is the owning groups

Then fix the permissions problem by modifying the Nginx user group.

sudo usermod-ag www-data nginx

The last restart of the Nginx service is OK.

Lnmp built, nginx under PHP file 404 but html file normal access "resolved"

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.