I try to update my PHP version to 7.4
on macOS Catalina with brew.
I did brew install [email protected]
If I check my version php -v
, I still see the old version PHP 7.3.11
?
What do I have to do?
Update:
After brew doctor
I get:
Warning: Homebrew’s sbin was not found in your PATH but you have
installed formulae that put executables in /usr/local/sbin. Consider
setting the PATH for example like so: echo ‘export
PATH="/usr/local/sbin:$PATH"’ >> ~/.profile
6
Answers
try:
or
if you use apache server:
if you use ngnix
Edit:
You can find my similar answer for [email protected].
brew install [email protected]
brew link --force --overwrite [email protected]
brew services start [email protected]
export PATH="/usr/local/opt/[email protected]/bin:$PATH"
export PATH="/usr/local/opt/[email protected]/sbin:$PATH"
I recently faced this issue, all the suggestion here didn’t work until I ran:
Then ran the command I was trying before and the error stopped, for my case it was php
dyld: Library not loaded: /usr/local/opt/openldap/lib/libldap-2.4.2.dylib
Referenced from: /usr/local/opt/[email protected]/bin/php
Reason: image not found
zsh: abort php -v
Using terminal of MacOS. Don’t use terminal in vscode.
If anyone want to downgrade php from latest 8.1.2 to 7.4 on systems demand, try the below commands with homebrew:
Installing PHP 7.4 :
Or