Complete macos PHP setup
FreeManual Apache & PHP multi-version setup on macOS
FreeFree tier
About Complete macos PHP setup
A detailed, step-by-step blog guide for experienced web developers to manually set up Apache 2.4 and multiple PHP versions on macOS (Sequoia/earlier) using Homebrew. Covers installation of Xcode Command Line Tools, Homebrew, Apache via Homebrew, and multiple PHP versions side-by-side. Written by the Grav CMS team, this guide aims to replace the need for MAMP Pro with a more flexible, command-line-driven environment. Includes warnings for beginners and a mention of the newer Reeve tool that automates the entire stack.
Key Features
Teaches installation of Xcode Command Line Tools
Covers Homebrew installation and path configuration
Shows how to install Apache 2.4 via Homebrew on macOS Sequoia
Supports running multiple PHP versions (e.g., via Homebrew/core)
Configures Apache to replace the pre-installed macOS Apache
Part of a multi-part series covering MySQL, virtual hosts, APC caching, and Xdebug
Warns that the guide is for experienced developers; suggests MAMP/MAMP Pro for beginners
Pros & Cons
Pros
- Free and open-source approach (no paid tools required)
- Leverages Homebrew for easy package management
- Allows running multiple PHP versions simultaneously for testing
- Provides more control than GUI-based solutions like MAMP Pro
- Comprehensive guide with clear step-by-step instructions
Cons
- Requires familiarity with command line and terminal usage
- Not suitable for beginner developers (explicitly warned)
- Manual setup can be time-consuming and error-prone
- Some steps may need adaptation for different macOS versions
- The guide is part of a series; you need to follow multiple posts for a full stack
Best For
Setting up a local web development environment on macOS with Apache and multiple PHP versionsReplacing MAMP Pro for more control and up-to-date buildsLearning manual configuration of Apache and PHP on macOSTesting web applications across different PHP versions
FAQ
What prerequisites are needed for this guide?
You need Xcode Command Line Tools and Homebrew installed. The guide provides instructions for both.
Is this guide suitable for beginners?
No, the guide is intended for experienced web developers. Beginners are recommended to use MAMP or MAMP Pro.
Does this guide cover MySQL and virtual hosts?
This is part one of a multi-part series. The second post covers MySQL, Apache virtual hosts, APC caching, and Xdebug installation.
Is there an easier alternative to setting this up manually?
Yes, the post mentions Reeve, a free open-source tool that automatically sets up and manages the entire stack including multiple PHP versions, Apache/nginx/Caddy, SSL, wildcard DNS, and databases.