Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

aagha's avatar
Level 1

brew on wsl2 and php

I'm trying to get php working on my wsl2 install using the brew instructions from the laracast vids:

I have Ubuntu running on wsl2 (Win 11) with brew:

> which brew
/home/linuxbrew/.linuxbrew/bin/brew
> brew -v
Homebrew 4.0.17
Homebrew/homebrew-core (git revision f59b029dad2; last commit 2023-04-18)

I installed [email protected] through brew. When I do:

> brew search php
==> Formulae
brew-php-switcher     php-cs-fixer          [email protected]               phplint               phpstan               pcp
php                   php-cs-fixer@2        [email protected] ✔             phpmd                 phpunit
php-code-sniffer      [email protected]               phpbrew               phpmyadmin            pup

But when I do php -v, I got nothing going on:

> php -v
Command 'php' not found, but can be installed with:
sudo apt install php7.4-cli

Why is Brew saying I have 8.1 installed, but php -v is saying I don't have php installed? How do I resolve this?

0 likes
0 replies

Please or to participate in this conversation.