Brew installation problems...If you are getting this error on MacOS (M1):

unable to load libxcrun (dlopen(/Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib, 0x0005)

you need to remove current Command line Tools:

                    sudo rm -r /Library/Developer/CommandLineTools
                  

and now try again to install homebrew

                    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
                  

Brew commands

Install PHP

                    brew install php
                  

Restart Redis

                    brew services restart redis

                  

MariaDB

                    // to connect
mysql -uroot

//To restart [email protected] after an upgrade:
brew services restart [email protected]