MAC HomeBrew 安装 php

查看PHP

brew search php
image.png

安装PHP

brew install [email protected]
image.png

将PHP加入PATH

打开 .bash_profile 文件

vim ~/.bash_profile

加入

export PATH="$(brew --prefix [email protected])/bin:$PATH"

执行

source ~/.bash_profile

加入 launchctl 控制启动

mkdir -p ~/Library/LaunchAgents
cp /usr/local/opt/[email protected]/[email protected] ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/[email protected]

启动PHP服务

brew services start [email protected]
image.png

你可能感兴趣的:(MAC HomeBrew 安装 php)