2

php -v works in individual terminals, but do not work in Visual Studio Code Terminal.

I tried php -v in Git Bash and Command Prompt in Windows, and all worked.

So I tried in VSC where I set default shell to Git Bash, but it shows error with bash: php: command not found (I added php bin path to Path)

Terminal at VSC do not get PATH variable?

lee
  • 185
  • 2
  • 8
  • 1
    I think you may reference the answer to [this question](https://superuser.com/questions/1238410/running-php-works-in-command-prompt-but-not-git-bash) – Koala Yeung Sep 27 '19 at 03:21
  • Thank you for comment. I typed `alias php='c/php-7.3.10-Win32-VC15-x64'` and not working on VSC again. It seems problem is related to VSC. I can use php command at independent Git Bash, but fails in VSC. – lee Sep 27 '19 at 04:13
  • Try to [hard code your PHP path in VSCode](https://stackoverflow.com/questions/43768614/how-to-set-php-executable-path-php-validate-executablepath-in-vscode-when-php-is/45240008#45240008). – Koala Yeung Sep 27 '19 at 04:31
  • Didn't work, too. It is obviously problem of VSCode. I just turned Bash on. Thank you for your answers. – lee Sep 30 '19 at 00:57

1 Answers1

0

I got the same problem... My problem was in VSC FlatPack version available in the Software Manager in Mint 18.3. I uninstalled it and got the original version on https://code.visualstudio.com See more at: https://github.com/microsoft/vscode/issues/44646

Eduardo K
  • 156
  • 1
  • 1
  • 10