Nginx and PHP-FPM User Rights description

Source: Internet
Author: User

Nginx itself cannot handle PHP, it is just a Web server. When a client request is received, if it is a PHP request, it is forwarded to the PHP interpreter for processing and returns the result to the client. If it is a static page, Nginx handles it itself and returns the result to the client.


The most used PHP interpreter under Nginx is fastcgi. In general, the PHP request forwarded to the FASTCGI management process processing, the FASTCGI management process to select the CGI sub-process processing, and then return the processing results to nginx.


In this process involves two users, one is nginx running user , one is php-fpm running user . If you are accessing a static file, you only need the user who is running nginx to have read or write access to the file.


And if the access is a PHP file, you first need to run the user to the file has Read permissions, read to the file after the discovery is a PHP file, then forwarded to PHP-FPM, at this time you need to PHP-FPM users have read access to the file or read and write permissions.


In General, the owner and owning group of Nginx running user, php-fpm running user, and Web root should be consistent.

I use the WWW user myself.

650) this.width=650; "src=" Http://static.oschina.net/uploads/space/2014/1010/143343_PFwT_727880.png "alt=" 143343_ Pfwt_727880.png "/>



This article is from the "Guilt Free" blog, so be sure to keep this source http://perofu.blog.51cto.com/6061242/1562165

Nginx and PHP-FPM User Rights description

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.