zoukankan      html  css  js  c++  java
  • nginx与php配置用户问题

    当配置nginx的nginx.conf 时,可参照如下配置:

    server {
      listen 80;
      server_name www.advancephp2017.com;
      access_log logs/advance.access.log;

      root /home/andrewghost/www/advancephp;
      location / {
        index index.html index.php;
      }
      location ~ .php$ {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
      }
    }

    在nginx.conf配置user(默认nobody),我在这里设为user andrewghost,注意,php7版本下需要对/usr/local/php/etc/php-fpm.d里面对www.conf作一点修改:

    user = andrewghost #和nginx.conf里的user对应,默认nobody

    group = team #你自己的组,默认nobody

    否则,只修改nginx,php文件访问的时候会报file not founds

  • 相关阅读:
    ssh 无密码互通
    React之jsx转js
    分布式事务参考
    js跨域解决方案
    idea编译时JDK版本变化
    计数算法
    Rocketmq消息持久化
    rocketmq安装
    nginx高可用配置
    nginx负载均衡设置
  • 原文地址:https://www.cnblogs.com/AndrewGhost/p/6506815.html
Copyright © 2011-2022 走看看