You have to edit the file .zshrc
vim ~/.zshrc
and Then you update the path for your php
type on "?" search "php" ... type enter, it will show you the line where php is. If not you have to add the path of your PHP.
You use Mamp, then it should on the root of mamp. set it on your .zshrc
This my .zshrc related to php :
#export PATH="/usr/local/opt/[email protected]/bin:$PATH"
#export PATH="/usr/local/opt/[email protected]/sbin:$PATH"
#export PATH="/usr/local/sbin:$PATH"
export PATH="/usr/local/opt/[email protected]/bin:$PATH"
export PATH="/usr/local/opt/[email protected]/sbin:$PATH"
export PATH="/usr/local/sbin:$PATH"