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

MrMooky's avatar

VSCode using outdated PHP

For some strange reason my VSCode suddenly uses the default php version shipped with macOS. I have a M1 Mac mini. Apparently, changing php.executablePath in my settings should fix it, but it does not work for me.

When I use which php from the build in macOS terminal, I get /opt/homebrew/bin/php, which is correct and uses PHP 8.0.9 as of now. But when using the VSCode terminal, which php gives me /usr/bin/php, which is not correct.

I added those lines to my settings file:

"php.validate.enable": true,
"php.validate.executablePath": "/opt/homebrew/bin/php",
"php.executablePath": "/opt/homebrew/bin/php",
"php.validate.run": "onSave"

But even after restarting, it gives me the outdated version. I'm using Homebrew with Valet.

Anybody experienced something similar and knows how to fix this?

0 likes
0 replies

Please or to participate in this conversation.