macOS BigSur - Unable to run bundled php version or brew php 8

13 Views Asked by At

After I've tried to install shopify-cli using homebrew without success, my dev environment on macOS big sur seems to not work. I've tried in terminal to run the command php -v or php localhost:8000 -t /my-site/ but I will see this error message

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicuio.70.dylib
  Referenced from: /usr/local/opt/[email protected]/bin/php
  Reason: image not found

I've tried to install php 8 using the command brew install php but this will produce this error

==> Fetching freetds
==> Downloading https://raw.githubusercontent.com/Homebrew/homebrew-core/cdae05f
Already downloaded: /Users/ziobru/Library/Caches/Homebrew/downloads/7b632fa6ee4cf65d34c6d977f0d52b2f41647860d8d12f976e61c1ac7a8e92c2--freetds.rb
==> Downloading https://www.freetds.org/files/stable/freetds-1.4.11.tar.bz2
dyld: Library not loaded: /usr/local/opt/openssl@3/lib/libssl.3.dylib
  Referenced from: /usr/local/opt/libssh2/lib/libssh2.1.dylib
  Reason: image not found
Error: [email protected]: Failed to download resource "freetds"
Download failed: https://www.freetds.org/files/stable/freetds-1.4.11.tar.bz2

Using the which php command will give me this result /usr/local/opt/[email protected]/bin/php, I'm a bit confused about this because it seems my php installation is gone.

How I can reinstall php on my macOS bigSur to be able to develop in php using the one installed on my machine?

0

There are 0 best solutions below