我使用了macos10.13
系统,用phpbrew
来管理多版本 php,系统自带的 php 版本是 7.1.16 ,我用 phpbrew 下载来 php5.6 的版本,然后我用命令phpbrew switch 5.6
切换了 php 版本,然后在终端下输入命令php -v
输出结果为:
PHP 5.6.30 (cli) (built: May 14 2019 18:30:16)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
输入命令php-fpm -v
输出结果为:
PHP 7.1.16 (fpm-fcgi) (built: Mar 31 2018 03:00:16)
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
web 页面输出phpinfo()
也是 7.1.16
系统自带的php-fpm
位置在/usr/sbin
,我尝试把我下载的 php-fpm5.6 的替换到这里,页面就 404
nginx 报错为:
2019/05/15 18:35:48 [error] 3125#0: *51 kevent() reported that connect() failed (61: Connection refused) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "127.0.0.1:82"
2019/05/15 18:35:48 [error] 3125#0: *51 open() "/usr/local/Cellar/nginx/1.15.12/html/50x.html" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "127.0.0.1:82"
2019/05/15 18:35:48 [error] 3125#0: *51 kevent() reported that connect() failed (61: Connection refused) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "127.0.0.1:82"
2019/05/15 18:35:48 [error] 3125#0: *51 open() "/usr/local/Cellar/nginx/1.15.12/html/50x.html" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "127.0.0.1:82"
ailed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "127.0.0.1:82"
2019/05/15 18:48:03 [error] 3125#0: *64 kevent() reported that connect() failed (61: Connection refused) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "127.0.0.1:82"
2019/05/15 18:48:03 [error] 3125#0: *64 open() "/usr/local/Cellar/nginx/1.15.12/html/50x.html" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "127.0.0.1:82"
html 解析的正常的,问题就出在 php-fpm,google 搜索两天也没解决,各位师傅可以帮我看看吗,我想让 php-fpm 变成 5.6 的
1
salamanderMH 2019-05-15 21:03:33 +08:00
用 docker 吧
|
2
GuangXiN 2019-05-15 21:08:26 +08:00 via Android
which php 看看程序在哪里
|
3
wxyoung 2019-05-15 21:08:43 +08:00
|
4
veike 2019-05-15 21:17:49 +08:00 via Android
安装 5.6 版本的 php-fpm 啊
|
5
0clickjacking0 OP @wxyoung 我用的是 phpbrew 安装的 php,不是用 brew 安装的 php
|
6
0clickjacking0 OP @GuangXiN which 就是在我的家目录下,因为我是用 phpbrew 安装的 5.6,而且 php -v 是 5.6 版本的
|
7
0clickjacking0 OP @veike 安装了,phpbrew 编译的时候我加了--fpm 的参数的
|
8
huanghaofu86 2019-05-15 21:40:56 +08:00
楼主,我也是搞 IOS 开发 ,可以加你扣吗我的是 2146 去掉 @ 274454
|
9
0clickjacking0 OP @huanghaofu86 哈哈哈,我不是搞 ios 开发的,mac 好用罢了
|
10
0clickjacking0 OP @salamanderMH 这是最后的办法吧,如果实在搞不好的话
|
11
torans 2019-05-15 21:56:25 +08:00 via iPhone
valet plus
|
12
Bardon 2019-05-15 22:21:46 +08:00
/path/to/php5-fpm -y /path/to/php5-fpm.conf -F 启动,没问题后再转到后台
不要直接替换二进制,默认配置文件格式都不太一样了,你 php5-fpm 都没起来,ps aux|grep php5 看下有无进程吧。 |
13
des 2019-05-15 23:14:00 +08:00 via iPad
试试 brew link ?
|
14
andychen1 2019-05-16 08:59:52 +08:00 via iPhone
哈哈😄,我估计是这样:Mac 是出厂就装了 PHP 的,就是你那个低版本的;另外你可能自己人装了 7.x 的
|
15
jsjscool 2019-05-16 14:12:09 +08:00
又不是生产环境,用啥 php-fpm ? 直接 php -S localhost:8080 搞定
|
16
LittleLease 2019-05-25 14:27:04 +08:00
直接用 docker 就好了
|
18
ccc825 2020-02-06 02:24:52 +08:00
域名挂了,还好找到你的 gitpage 了。搞这个搞了一天头都大了 T。T
|
19
0clickjacking0 OP |