LNMP Environment permissions issue causes PHP write cache failure to be resolved

Source: Internet
Author: User
Tags fpm php write
Environment: CentOS6.9 + nginx + php-fpm + mysql,web environment software is installed using Yum.
使用yum安装nginx,启动nginx进程时默认是使用的系统用户是nginx,  编辑/etc/  nginx.conf文件可看到user nginx;使用yum安装php-fpm,  默认用户有可能为apache,查看/etc/php-fpm.conf或/etc/php  -fpm.d/www.conf下找到user改为nginx即可解决问题。
nginx处理php流程:如果是js、css、html等静态文件,nginx会直接返回给  客户端。如果遇到php等文件会,nginx会将php文件交给php进程处理,  处理完毕再返回给nginx进程,由nginx返回给客户端。此时如果php的运  行用户不是nginx就有可能导致php进程没有权限操作网站文件,比如生  成缓存等写入操作会被禁止。
查看PHP进程用户: ps -ef | grep php

LNMP Environment permissions issue causes PHP write cache failure to be 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.