1
V69EX 2020-02-13 20:04:46 +08:00
如果所有的可能都排除了,那么,最大的可能就是 SELinux 的策略配置了……
|
3
MeteorCat 2020-02-13 20:16:13 +08:00 via Android
是不是 session 用户有问题,检查是不是 yum/apt 安装 php-fpm 的用户组是不是 apache,而你的 nginx 没有修改 session 权限
|
4
station OP @MeteorCat
user = nginx ; RPM: Keep a group allowed to write in log dir. group = nginx ; The address on which to accept FastCGI requests. ; Valid syntaxes are: ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on ; a specific port; ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on ; a specific port; ; 'port' - to listen on a TCP socket to all addresses ; (IPv6 and IPv4-mapped) on a specific port; ; '/path/to/unix/socket' - to listen on a unix socket. ; Note: This value is mandatory. listen = /run/php-fpm/fpm.sock ; Set listen(2) backlog. ; Default Value: 511 ;listen.backlog = 511 ; 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. ; Default Values: user and group are set as the running user ; mode is set to 0660 listen.owner = nginx listen.group = nginx listen.mode = 0660 |
6
station OP |
7
MeteorCat 2020-02-13 20:48:05 +08:00 via Android
@station 默认 session 目录看看权限组,在 /var/lib/php/session
|
8
station OP |
10
dilu 2020-02-14 09:15:42 +08:00
1. 确认关闭 SeLinux
2. 确认 nginx 的运行用户 3. 确认 php-fpm 的运行用户要跟 nginx 一直 4. 确认代码目录真是存在切存在 index.php 并且文件属于上面两条的用户或者用户组 5. 确认 sock 文件存在并且上面的用户能 read 6. server 换成 unix:///run/php-fpm/fpm.sock; 7. 还是不行请贴一下 debug 下面的 error_log 你这是在安装 nextcloud 我以前搞过 没遇到你这个问题 |
11
encro 2020-02-14 09:35:58 +08:00
1,通过 ps 查看 php-fpm 进程的配置文件;
2,查看 php-fpm 配置文件,开启 fpm 的 access 和 error 日志; 3,重启 fpm,用 ps 看看是否运行成功; 4,查看 fpm 日志,是否有请求过来,没有的话,修改监听方式为端口试试; 一般就楼上的问题: 1,关闭 SeLinux ; 2,nginx,fpm,代码,sock 文件,log 目录所属用户一致; 3,server 换成 unix:///run/php-fpm/fpm.sock; |
12
station OP @dilu
1 .确认已关闭 selinux 2. nginx 和 php-fpm 的运行用户确认一致 3. nextcloud 的文件夹确实存在于 /var/www 目录下,且用户与用户组为 nginx 4. sock 文件存在,权限正确 5. server 换成 unix:///run/php-fpm/fpm.sock; 结果一样的 2020/02/14 04:51:01 [notice] 1632#1632: start worker processes 2020/02/14 04:51:01 [notice] 1632#1632: start worker process 1633 2020/02/14 04:51:01 [notice] 1632#1632: start worker process 1634 2020/02/14 04:51:05 [notice] 1633#1633: *1 "^" matches "/nextcloud", client: 192.168.1.238, server: localhost, request: "GET /nextcloud HTTP/1.1", host: "192.168.1.157" 2020/02/14 04:51:05 [notice] 1633#1633: *1 rewritten data: "/nextcloud/index.php", args: "", client: 192.168.1.238, server: localhost, request: "GET /nextcloud HTTP/1.1", host: "192.168.1.157" 2020/02/14 04:51:05 [notice] 1633#1633: *1 "^" matches "/nextcloud/", client: 192.168.1.238, server: localhost, request: "GET /nextcloud/ HTTP/1.1", host: "192.168.1.157" 2020/02/14 04:51:05 [notice] 1633#1633: *1 rewritten data: "/nextcloud/index.php", args: "", client: 192.168.1.238, server: localhost, request: "GET /nextcloud/ HTTP/1.1", host: "192.168.1.157" 2020/02/14 04:51:05 [notice] 1633#1633: *1 "^" matches "/nextcloud", client: 192.168.1.238, server: localhost, request: "GET /nextcloud HTTP/1.1", host: "192.168.1.157" 2020/02/14 04:51:05 [notice] 1633#1633: *1 rewritten data: "/nextcloud/index.php", args: "", client: 192.168.1.238, server: localhost, request: "GET /nextcloud HTTP/1.1", host: "192.168.1.157" 2020/02/14 04:51:05 [notice] 1633#1633: *1 "^" matches "/nextcloud/", client: 192.168.1.238, server: localhost, request: "GET /nextcloud/ HTTP/1.1", host: "192.168.1.157" 2020/02/14 04:51:05 [notice] 1633#1633: *1 rewritten data: "/nextcloud/index.php", args: "", client: 192.168.1.238, server: localhost, request: "GET /nextcloud/ HTTP/1.1", host: "192.168.1.157" 2020/02/14 04:51:06 [notice] 1633#1633: *1 "^" matches "/nextcloud", client: 192.168.1.238, server: localhost, request: "GET /nextcloud HTTP/1.1", host: "192.168.1.157" 2020/02/14 04:51:06 [notice] 1633#1633: *1 rewritten data: "/nextcloud/index.php", args: "", client: 192.168.1.238, server: localhost, request: "GET /nextcloud HTTP/1.1", host: "192.168.1.157" 2020/02/14 04:51:06 [notice] 1633#1633: *1 "^" matches "/nextcloud/", client: 192.168.1.238, server: localhost, request: "GET /nextcloud/ HTTP/1.1", host: "192.168.1.157" 2020/02/14 04:51:06 [notice] 1633#1633: *1 rewritten data: "/nextcloud/index.php", args: "", client: 192.168.1.238, server: localhost, request: "GET /nextcloud/ HTTP/1.1", host: "192.168.1.157" |
13
station OP @encro
- - 14/Feb/2020:04:45:19 -0500 "GET /nextcloud/index.php" 500 /var/www/nextcloud/index.php 61.445 4096 81.37% - - 14/Feb/2020:04:45:47 -0500 "GET /nextcloud/index.php" 500 /var/www/nextcloud/index.php 5.365 2048 0.00% - - 14/Feb/2020:04:45:47 -0500 "GET /nextcloud/index.php" 500 /var/www/nextcloud/index.php 4.944 2048 0.00% - - 14/Feb/2020:04:45:47 -0500 "GET /nextcloud/index.php" 500 /var/www/nextcloud/index.php 4.700 2048 0.00% - - 14/Feb/2020:04:51:05 -0500 "GET /nextcloud/index.php" 302 /var/www/nextcloud/index.php 1.014 2048 0.00% - - 14/Feb/2020:04:51:05 -0500 "GET /nextcloud/index.php" 500 /var/www/nextcloud/index.php 3.086 2048 324.04% - - 14/Feb/2020:04:51:05 -0500 "GET /nextcloud/index.php" 302 /var/www/nextcloud/index.php 0.341 2048 0.00% - - 14/Feb/2020:04:51:05 -0500 "GET /nextcloud/index.php" 500 /var/www/nextcloud/index.php 2.090 2048 0.00% - - 14/Feb/2020:04:51:06 -0500 "GET /nextcloud/index.php" 302 /var/www/nextcloud/index.php 0.343 2048 0.00% - - 14/Feb/2020:04:51:06 -0500 "GET /nextcloud/index.php" 500 /var/www/nextcloud/index.php 4.010 2048 0.00% |
14
station OP @encro
[14-Feb-2020 04:32:54] NOTICE: fpm is running, pid 919 [14-Feb-2020 04:32:54] NOTICE: ready to handle connections [14-Feb-2020 04:32:54] NOTICE: systemd monitor interval set to 10000ms [14-Feb-2020 04:43:39] NOTICE: Terminating ... [14-Feb-2020 04:43:39] NOTICE: exiting, bye-bye! [14-Feb-2020 04:43:39] NOTICE: fpm is running, pid 1607 [14-Feb-2020 04:43:39] NOTICE: ready to handle connections [14-Feb-2020 04:43:39] NOTICE: systemd monitor interval set to 10000ms |
16
msg7086 2020-02-14 18:05:40 +08:00
500 错误不就是连上了么……
|
17
encro 2020-02-14 18:26:40 +08:00
500 应用程序错误,
你开启 fpm 的 access log 看下。 开启 php.ini 的 display_error=ON,error_reporting=E_ALL 将 index.php 改为 <?php echo 'hello';exit; 测试 如果不是很会环境配置的话,建议用宝塔吧。 |
18
station OP |
19
encro 2020-02-14 20:29:10 +08:00
@station
php-fpm.conf 还有一个 access log 默认是不开启的 php_flag[display_errors] = on php_admin_value[error_log] = /var/log/php-fpm/www-error.log php_admin_flag[log_errors] = on access.log string Access log 文件。 默认值:不设置 access.format string access log 的格式。 默认值: "%R - %u %t \"%m %r\" %s" access.log = log/$pool.access.log #每一个请求的访问日志,默认是关闭的。 access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" #设定访问日志的格式。 [php-fpm 配置详解]( https://juejin.im/entry/5870bc8961ff4b005c3c47ec) |