如何在Mac上更改PHP-FPM端口 [英] How to change PHP-FPM port on Mac

查看:122
本文介绍了如何在Mac上更改PHP-FPM端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我没有使用php或php-fpm,但是它占用了端口9000.我需要端口9000.我想更改端口.我在/etc/php-fpm.conf /etc/php-fpm.d/www.conf 中进行了更改.听= 127.0.0.1:9005.仍在听 9000.如果我杀死它,它只会立即使用不同的 PID 重新加载.

I'm not using php or php-fpm, but it's hogging port 9000. I need port 9000. I'd like to change the port. I changed it in /etc/php-fpm.conf and /etc/php-fpm.d/www.conf. listen = 127.0.0.1:9005. Still listening on 9000. If I kill it it just loads back up instantly with a different PID.

我也可以卸载它,但是我也不知道该怎么做.有什么想法吗?

I'm ok uninstalling it too, but I can't figure out how to do that either. Any ideas?

推荐答案

您拥有哪个php版本,并且是否通过自制软件安装了该版本?

which php version do you have and did you install it via homebrew?

我今天遇到了这个问题,并通过更改了侦听端口的配置来解决了这个问题:

I was having this problem today and solved it by changing the configuration of the listening port:

在配置文件中:/usr/local/etc/php/7.2/php-fpm.d/www.conf

将行 listen = 127.0.0.1:9000 更改为所需的任何端口

change the line listen = 127.0.0.1:9000 to whatever port you want

如果没有配置文件,则复制文件时可能是酿造问题.在尝试更改 www.conf :

If you don't have the config file it might have been a brew problem when copying files. You have to do something like this before attempting to change www.conf:

cd $(brew --prefix php@7.2)cp -R .bottle/*/usr/local/

所有功劳归于该博客文章: https://www.dionysopoulos.me/custom-apache-and-php-server-on-macos-the-definitive-2019-edition/

All the credits go to this blogpost: https://www.dionysopoulos.me/custom-apache-and-php-server-on-macos-the-definitive-2019-edition/

这篇关于如何在Mac上更改PHP-FPM端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆