1 min read
By default, macOS includes a slightly outdated PHP. To install and use the latest PHP on macOS, you can use one of the following solutions:
The following stacks include PHP, webserver, database, and additional tools for developing PHP applications on your workstation:
brew install mariadb
If you're developing PHP applications on your local workstation, PHP also has a useful built-in web server for localhost development. It is not intended to be used for production environments.
Inside your project folder you can run it from the command line using PHP CLI SAPI:
php -S localhost:8000
http://localhost:8000/ in your browser to access it.