array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'en', ), 'this' => array ( 0 => 'install.macosx.packages.php', 1 => 'Using Packages', ), 'up' => array ( 0 => 'install.macosx.php', 1 => 'Installation on macOS', ), 'prev' => array ( 0 => 'install.macosx.php', 1 => 'Installation on macOS', ), 'next' => array ( 0 => 'install.macosx.bundled.php', 1 => 'Using the bundled PHP prior to macOS Monterey', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'install/macos/packages.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

Using Packages

There are a few pre-packaged and pre-compiled versions of PHP for macOS. This can help in setting up a standard configuration, but if you need to have a different set of features (such as a secure server, or a different database driver), you may need to build PHP and/or your web server yourself. If you are unfamiliar with building and compiling your own software, it's worth checking whether somebody has already built a packaged version of PHP with the features you need.

The quickest way to install php on macOS is with homebrew:

  1. install homebrew, by following the instructions at » brew.sh

  2. brew install php

The following alternative resources also offer easy to install packages and precompiled binaries for PHP on Mac OS: