Home ブログ一覧

Homebrew で「No formula or cask found for “php@7”.」と出て、phpを更新できない問題

更新日 公開日

ここ半年、HomebrewでPHPを更新しようとして、「brew search php@7」としても、

Error: No formulae or casks found for "php@7".

この辺りのエラーが出て、PHPが更新できない状態だった。あんまりこの辺り詳しくなかったんだけど、検索しても原因がわからず、放置案件にしてたんだけど、別件で調べものしてる時に解決法発見!

何気に「brew doctor」をやってみると、

Warning: Some taps are not on the default git origin branch and may not receive
updates. If this is a surprise to you, check out the default branch with:
git -C $(brew --repo homebrew/core) checkout master

というWarning を発見。前回も「brew doctor」は、やってみたんだけど、気づかなかった。なので、ターミナルに

git -C $(brew --repo homebrew/core) checkout master

をコピペして、エンター!して、再度「brew search php@7」を実行すると、

==> Formulae
php@7.2        php@7.3        php@7.4

これで更新できます!

Contact

お問い合わせ
お電話でのお問い合わせ

0120-967-653

ご質問・お問い合わせ
お問い合わせフォーム
商品・サービスへのご質問・ご不明な点などがありましたら、お気軽にお問い合わせください。