0

I installed php 8.0 on my MacBook pro (MacOS 11.2.3) using homebrew. I'm a newbie and I don't know if I added PHP to my $PATH correctly. My path in .bashrc looks like this: /Users/johnrimestad/Library/Python/3.8/bin:/Library/Frameworks/Python.framework/Versions/3.9/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/Cellar/php/8.0.3

When I run "which php" in my terminal, it still shows the path of the older version: /usr/local/bin/php.

Any advice is greatly appreciated

  • 2
    That's because `/usr/local/bin` comes before `/usrc/local/Cellar...`, cf. this thread on Unix & Linux SE on [how to correctly add a path to a path](https://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path). Just swap them and you should be fine. – nosurs Apr 15 '21 at 19:29
  • Found the answer: https://stackoverflow.com/questions/2526085/how-do-i-upgrade-php-in-mac-os-x – John R. Rimestad Apr 15 '21 at 19:33
  • Oh, thanks a lot, nosurs :) – John R. Rimestad Apr 15 '21 at 19:33
  • 2
    Does this answer your question? [How to permanently set $PATH on Linux/Unix?](https://stackoverflow.com/questions/14637979/how-to-permanently-set-path-on-linux-unix) – Mohamed Bdr Apr 16 '21 at 08:55

0 Answers0