This might be of use
Jul 25, 2021
3
Level 19
Switching PHP versions on mac
Hi there, I'm trying to switch to an older version than the pre-installed version with no luck. I've tried to link the old version using brew
brew unlink [email protected] && brew link --force [email protected]
and that's seems to go fine
Unlinking /usr/local/Cellar/[email protected]/7.2.34_4.reinstall.reinstall... 14 symlinks removed.
Linking /usr/local/Cellar/[email protected]/7.2.34_4.reinstall.reinstall... 14 symlinks created.
If you need to have this software first in your PATH instead consider running:
echo 'export PATH="/usr/local/opt/[email protected]/sbin:$PATH"' >> ~/.zshrc
but when I check again for the php version it still uses the php7.3 which is pre-installed and I cann't use it with valet either
➜ ~ php -v
WARNING: PHP is not recommended
PHP is included in macOS for compatibility with legacy software.
Future versions of macOS will not include PHP.
PHP 7.3.24-(to be removed in future macOS) (cli) (built: May 8 2021 09:40:37) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.24, Copyright (c) 1998-2018 Zend Technologies
Please or to participate in this conversation.