skip to Main Content

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

3

Answers


  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
    
    Login or Signup to reply.
  2. Try write this in terminal:
    git -C $(brew –repository homebrew/core) checkout master

    Login or Signup to reply.
  3. I recently had this exact problem and tried

    brew tap homebrew/core
    

    However, it didn’t work. This did work for me

    rm -rf $(brew --repo homebrew/core)
    brew tap homebrew/core
    brew install php
    

    Hope this helps!

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search