Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install PHP 7.2 on macOS Big Sur using Homebrew?

I want to install PHP 7.2 on MacBook Pro M1, macOS Big Sur (11.5.2).

I already read an article (How To Install a PHP 7.2 on macOS 10.15 Catalina Using Homebrew and PECL), but it doesn't work for me.

I used Homebrew to install PHP 7.2 using this command:

brew install [email protected]

But I've got this error:

[email protected] has been disabled because it is deprecated upstream!
like image 482
mustafa hasria Avatar asked Aug 31 '25 01:08

mustafa hasria


1 Answers

Since PHP 7.2 is not supported anymore, it's got delisted from the Hombrew core repository.

You've to find a third-party repository that still contains an older PHP version, such as the shivammathur/php repository.

You need to tap the repository like this in your Homebrew:

brew tap shivammathur/php

Then you can install PHP 7.2 like this:

brew install shivammathur/php/[email protected]

You can find more information around the above tap and available versions on its GitHub repository.

like image 117
nekofar Avatar answered Sep 02 '25 16:09

nekofar