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

LaraBABA's avatar

VS Code issue -Error spawning PHP: Command failed with exit code 1:

Hello,

I am struggling with this, posted it on stackoverflow sometime ago but not help.

Has anyone ever experienced this issue with VS code please?

Error spawning PHP: Command failed with exit code 1: C:\laragon\bin\php\php-8.1.2-Win32-vs16-x64 --version 'C:\laragon\bin\php\php-8.1.2-Win32-vs16-x64' is not recognized as an internal or external command, operable program or batch file.

The url "C:\laragon\bin\php\php-8.1.2-Win32-vs16-x64" is correct.

I cannot work it out. Trying to move away from phpstorm to VScode and I am still new with VSCode.

Thanks

0 likes
4 replies
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

Are you sure you are not missing \php.exe ?

C:\laragon\bin\php\php-8.1.2-Win32-vs16-x64\php.exe

1 like
KeemCodede's avatar

@LaraBABA hello, can i know where to put the url? bcs i'm new to this stuff and encounter the same error

Please or to participate in this conversation.