php-fpm - OSX PHP56 nginx 伺服器 許可權問題,導致php連結500錯誤

來源:互聯網
上載者:User
[07-Dec-2015 17:07:08] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root[07-Dec-2015 17:07:08] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root

查看php-fpm日誌發現以上提示,嘗試將php-fpmusergroup修改成目前使用者所匹配的,錯誤依舊。

通過lsof -Pni4 | grep LISTEN | grep php看到php-fpm確實是以目前使用者而非root使用者運行。

php-fpm   51546 joshua    7u  IPv4 0xef21d7f98be9663      0t0  TCP 127.0.0.1:9056 (LISTEN)php-fpm   51551 joshua    0u  IPv4 0xef21d7f98be9663      0t0  TCP 127.0.0.1:9056 (LISTEN)php-fpm   51552 joshua    0u  IPv4 0xef21d7f98be9663      0t0  TCP 127.0.0.1:9056 (LISTEN)php-fpm   51553 joshua    0u  IPv4 0xef21d7f98be9663      0t0  TCP 127.0.0.1:9056 (LISTEN)

回複內容:

[07-Dec-2015 17:07:08] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root[07-Dec-2015 17:07:08] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root

查看php-fpm日誌發現以上提示,嘗試將php-fpmusergroup修改成目前使用者所匹配的,錯誤依舊。

通過lsof -Pni4 | grep LISTEN | grep php看到php-fpm確實是以目前使用者而非root使用者運行。

php-fpm   51546 joshua    7u  IPv4 0xef21d7f98be9663      0t0  TCP 127.0.0.1:9056 (LISTEN)php-fpm   51551 joshua    0u  IPv4 0xef21d7f98be9663      0t0  TCP 127.0.0.1:9056 (LISTEN)php-fpm   51552 joshua    0u  IPv4 0xef21d7f98be9663      0t0  TCP 127.0.0.1:9056 (LISTEN)php-fpm   51553 joshua    0u  IPv4 0xef21d7f98be9663      0t0  TCP 127.0.0.1:9056 (LISTEN)

改fpm配置讓fpm以你想要使用者運行,

sudo vim /etc/php-fpm.d/www.conf

; Set permissions for unix socket, if one is used. In Linux, read/write; permissions must be set in order to allow connections from a web server. Many; BSD-derived systems allow connections regardless of permissions.; Default Values: user and group are set as the running user;                 mode is set to 0660;listen.owner = nobody;listen.group = nobody;listen.mode = 0660; Unix user/group of processes; Note: The user is mandatory. If the group is not set, the default user's group;       will be used.; RPM: apache Choosed to be able to access some dir as httpduser = apache; RPM: Keep a group allowed to write in log dir.group = apache
  • 相關文章

    聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    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.