Multiple instance PHP on Macbook

I know some people will suggest me with phpbrew to build and switch with different php version...and it worked. I have side hustle where I need mysql worked as db. Unfortunately, I've compiled different php version (7.1 -7.4) with +pdo +mysql extension and always compiled error. When I tried again today, this article gave me a glimmer of hope πŸ‘ΌπŸ» .

In my case, I installed php 8 with brew

brew install php //where brew set php 8 as default

and then i installed php 7.2

brew install php@7.2

and this is the good part 😬. First, unlink php and create php link with any php version you want (in my case, i want php@7.2 linked) 🀭

brew unlink php && brew link --overwrite --force php@7.2