杀死进程 killall php-fpm
重启进程 /opt/homebrew/Cellar/php@7.4/7.4.26_1/sbin/php-fpm
[21-Feb-2022 18:06:28] ERROR: unable to bind listening socket for address ‘127.0.0.1:9000’: Address already in use (48)
查看进程 lsof -i:9000
再次强制杀死 kill -9 72269
查看进程 lsof -i:9000
发现进程变了 但是并没有杀死 因为有可能自动启动了
在mac中brew安装php会自动创建homebrew.mxcl.php.plist 自启动文件
检查plist是否正确:plutil ~/Library/LaunchAgents/homebrew.mxcl.php.plist
然后加载list文件,配置生效:launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php.plist
发现会报错误:
是因为php-fpm已经重启了 不可以再次配置 unload可以卸载配置
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.php.plist
卸载之后查看一下9000端口是否还在 还在kill掉就不会重启了
如果想要配置生效
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.php.plist
这样就可以了