

However, if you want to install PHP 7.1 that is available as well.I'm running on Mac OS X 10.6.8 Snow Leopard.įYI: I can't upgrade my OS so that is not an option for me right now. In this example, I'll install PHP 7.2 as that is the latest stable version of PHP. Installing PHPįirst, choose the version of PHP you want to install. While installing PHP OSX is just a few steps, I'll walk you through each of them. It's available for Mac OS 10.6+ ( Snow Leopard to Mojave). PHP OSX is a package installer for PHP versions 5.3 to 7.3 (current). But I found a pre-packaged alternative - PHP OSX.

So what do you do if you want to upgrade or install a different PHP version on your Mac? Well, you could use Homebrew. In fact, macOS Mojave was the first time the pre-installed version was recent - although still not the latest PHP version. Many of these PHP versions are already end of life. Mac OS 10.15 ( Catalina) pre-installed with PHP 7.3.Mac OS 10.14 ( Mojave) pre-installed with PHP 7.1.Mac OS 10.12 ( Sierra) pre-installed with PHP 5.6.Mac OS 10.11 ( El Capitan) pre-installed with PHP 5.5.Unfortunately, the pre-installed version of PHP with macOS is outdated: For those reasons, I recommend following my latest tutorial on installing Apache, MySQL, and PHP on macOS using Docker.Īs noted in my posts on installing Apache, PHP and MySQL on Mac OS X, Mac OS X comes pre-installed with Apache and PHP. If you are running macOS Mojave or higher, the recommended solutions in this tutorial may no longer work.
