0

I'm on Windows 8.1 with multiple PHP versions installed under Xampp using the method described here.

In VSCode I'm using the Git Bash terminal.

The default version of PHP is set to 5.6. So running the command:

php -version

results in:

PHP 5.6.30 (cli)...

How can I temporarily run php 7.3 from the terminal?

  • php.exe for 7.3 is here: C:\xampp\php73
Leon
  • 1,478
  • 3
  • 16
  • 20
  • 4
    Just call it directly from your command prompt: `C:\xampp\php73\php.exe ` – catcon Aug 01 '19 at 09:22
  • 2
    Also your title and question doesn't match – catcon Aug 01 '19 at 09:22
  • This is what I personally did when I had to run two PHP versions on Windows using XAMPP: https://stackoverflow.com/a/45881681/408777 – M. Suleiman Aug 01 '19 at 13:17
  • 1
    @catcon Thanks: "C:\xampp\php73\php.exe" --version (in quotes works). Sorry about the title - early morning pre-coffee post - fixed now. – Leon Aug 01 '19 at 15:30
  • 1
    It's best if the comment above will be posted as an answer. It will be helpful for others. – fmsthird Nov 19 '20 at 02:47

1 Answers1

0

The solution is to call the appropriate version with the full path. In this case:

"C:\xampp\php73\php.exe" --version
Leon
  • 1,478
  • 3
  • 16
  • 20