'Error when install PHP with brew in OS Monterey

I got php is deleted in OS Monterey, so I try to install it via Homebrew

I already install Homebrew, update tap to shivammathur/php and use this command

brew install shivammathur/php/[email protected]

but I got this response code

fatal: Could not resolve HEAD to a revision
Warning: No available formula with the name "httpd" (dependency of shivammathur/php/[email protected]).
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.

When I check brew version with brew --version I got this info

Homebrew 3.3.2
Homebrew/homebrew-core (no Git repository)
Homebrew/homebrew-cask (git revision 5c43c2133d; last commit 2021-11-06)

is that no Git repository issue related with why I cant install php in my device? How to solve this issue

I need this to install composer and install Laravel, so install XAMPP I think is not clear solution right now

Thankyou



Solution 1:[1]

As the output of brew --version says homebrew-core repository is missing, that is why brew is not able to find httpd.

Homebrew/homebrew-core (no Git repository)

Please tap the core repository and try again.

brew tap homebrew/core

Solution 2:[2]

Try write this in terminal: git -C $(brew --repository homebrew/core) checkout master

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Shivam Mathur
Solution 2 Yuriy Chabarenko