Update Php on MacOS to run kirby in local

Hi there !
I tried to install a local version of Kirby on my mac to test it.
I try to do the same as the video but I have an error page instead.
I have this in terminal

php -S localhost:8080 kirby/router.php
PHP 7.1.33 Development Server started at Fri Feb 19 12:26:29 2021

And this on my page:

This page is currently offline. We are very sorry for the inconvenience and will fix it as soon as possible.
Advice for developers and administrators:
Change the PHP version to 7.3, 7.4 or 8.0 (PHP 7.4 is recommended) 

How can i update the php version to 7.4 or 8 ?
Thanks

brew install php@7.4

I did this few weeks ago… don’t remenber how :slight_smile:

brew install php@7.4
brew link --force --overwrite php@7.4
brew services start php@7.4
export PATH="/usr/local/opt/php@7.4/bin:$PATH"
export PATH="/usr/local/opt/php@7.4/sbin:$PATH"

https://stackoverflow.com/questions/64684713/update-php-to-7-4-macos-catalina-with-brew

Hi, thanks for your quick responses.

I have tried this procedure :
https://brew.sh/index_fr

I pasted this code in terminal to install homebrew:

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

Nothing changed. Then I typed as @caplod suggested

brew install php@7.4

Nothing changed. PHP is still the same.
Then I pasted the @bntwmrt code

brew install php@7.4
brew link --force --overwrite php@7.4
brew services start php@7.4
export PATH=“/usr/local/opt/php@7.4/bin:$PATH”
export PATH=“/usr/local/opt/php@7.4/sbin:$PATH”

I don’t how and why because this is magic for me, but now it work !
I can now try Kirby.

Thanks to @caplod and @bntwmrt for your help.
Have a good day !

1 Like