What are the options to upgrade PHP on macOS Mojave 10.14.2?

Viewed 1459

While trying to upgrade PHP on macOS Mojave 10.14.2 using curl -s https://php-osx.liip.ch/install.sh | bash -s 7.3 , i'm seeing this warning:

konathal-OSX:sbin konathal$ curl -s https://php-osx.liip.ch/install.sh 
| bash -s 7.3
****
[WARNING]
Detected macOS Mojave 10.14. There are serious issues with it, due to 
the original apache not loading
foreign libraries anymore. PHP within apache will most certainly not 
work anymore if you proceed!
The cli version still will.
See this issue at https://github.com/liip/php-osx/issues/249 for 
details and discussion
****
Restart this script with
 curl -s https://php-osx.liip.ch/install.sh | bash -s force 7.3
to really install it
****

What is the best way to upgrade PHP on macOS Mojave?

1 Answers

I like homebrew.

https://brew.sh

Eg. On cli brew install php@7.2 or php@7.1 etc. I also use docker on Mac a lot to run containers with PHP.

Very convenient: you can easily switch the PHP versions with the brew php switcher script. Find it using brew search php :-).

Related