The Reality of Installing PHP 7.2 on macOS Big Sur
Attempting to install php@7.2 on a modern Mac immediately reveals why this specific version has become obsolete for development workflows. When you run the command brew install php@7.2, Homebrew correctly flags the package as deprecated upstream. The error message php@7.2 has been disabled because it is deprecated upstream! is not a bug in your environment; it is a deliberate decision by the PHP maintainers to stop building and maintaining versions that lack critical security patches and modern language features.
On macOS Big Sur, especially on Apple Silicon (M1) Macs, relying on legacy PHP versions introduces significant friction. The primary obstacle isn't just the deprecation warning itself, but the incompatibility of older PHP binaries with newer system libraries and the ARM64 architecture found in M1 chips. Even if you manage to force an installation using --force, you will likely encounter immediate failures when trying to load extensions or run scripts due to missing dependencies that were updated in subsequent macOS releases.
The architectural shift from Intel to Apple Silicon presents another layer of complexity. Homebrew has been transitioning its formulae to support universal binaries, but older PHP versions like 7.2 often lack the necessary build tags for M1 chips. You might see an installation succeed on an M1 Mac only to find that the resulting binary runs in emulation mode or crashes upon execution because it was compiled specifically for x86_64 architecture. This mismatch makes php@7.2 fundamentally unreliable as a primary runtime environment.
Why Deprecation Matters Beyond Warnings
The deprecation of PHP 7.2 is not merely a suggestion to upgrade; it is a statement about support lifecycle. The official End of Life (EOL) for PHP 7.2 occurred in November 2019. By the time you are running macOS Big Sur, released in late 2020, the version you are trying to install is already nearly two years past its supported lifespan.
Maintaining a production or development stack on an EOL version means accepting known vulnerabilities without access to security patches. If you require PHP 7.2 for legacy code that cannot be ported to newer versions like PHP 8.0 or 8.1, the Homebrew tap approach is no longer viable. The upstream community has moved away from providing formulae for these versions because the cost of maintaining them outweighs the benefit for most users.
Alternative Strategies for Legacy Code
If you absolutely must run PHP 7.2 on Big Sur due to legacy application constraints, Homebrew's standard installation path is effectively blocked by design. However, this does not mean the task is impossible; it simply requires abandoning brew install in favor of a self-contained environment.
The most robust solution for running deprecated versions on modern macOS is using a containerized environment or a local Docker setup. By isolating PHP 7.2 within a Docker container, you can run an x86_64-based image regardless of your host Mac's architecture. This approach sidesteps the issue of Homebrew disabling the formula and ensures that your legacy application runs in a controlled environment where you have full control over the OS version and dependencies.
Alternatively, you can download the official source tarball for PHP 7.2 from the archive maintained by the PHP team. Once downloaded, you must compile it manually against your system's libraries. This process is significantly more involved than using Homebrew, requiring you to configure phpize, set up paths for extensions, and explicitly handle any architecture-specific build flags. While this grants you a functional binary, it forfeits the convenience of package management tools like Homebrew for updating that specific PHP instance.
The Modern Stack Recommendation
For new projects, the recommendation is unequivocally to use PHP 8.x. The performance improvements, JIT compilation capabilities introduced in recent versions, and the native support for modern macOS features make older versions a liability rather than an asset. If your project relies on Composer packages that have dropped support for PHP 7.2, you will inevitably hit a wall trying to resolve dependencies with an older interpreter.
The transition to newer PHP versions is rarely difficult enough to warrant clinging to a deprecated release. Most modern frameworks, including Laravel, provide clear migration paths or offer tools to assist in upgrading legacy codebases. Sticking with PHP 7.2 on macOS Big Sur effectively locks you out of the latest ecosystem advancements and security updates.
If you need guidance on setting up a modern PHP development environment that works seamlessly across Intel and Apple Silicon Macs, consider exploring resources like https://laravelcompany.com which often provide tutorials on configuring the stack for current best practices.
