cannot run php command in php dir #3070

Closed
opened 2026-01-30 23:12:14 +00:00 by claunia · 1 comment
Owner

Originally created by @renxiaobin on GitHub (Aug 2, 2019).

in win10 64bit
I unzip php7.3 into disk C
then using windows terminal run "php -v" in dir "c:/php7.3", like below
image

but it works in cmd
image

Another, "./php -v" in windows terminal works well, I think it is so weird for using

Originally created by @renxiaobin on GitHub (Aug 2, 2019). in win10 64bit I unzip php7.3 into disk C then using windows terminal run "php -v" in dir "c:/php7.3", like below ![image](https://user-images.githubusercontent.com/7477220/62364319-b976e280-b553-11e9-9803-cdf52dc956d7.png) but it works in cmd ![image](https://user-images.githubusercontent.com/7477220/62364402-f347e900-b553-11e9-8459-34be7e5e8ef1.png) Another, "./php -v" in windows terminal works well, I think it is so weird for using
claunia added the Needs-TriageNeeds-Tag-FixResolution-Answered labels 2026-01-30 23:12:14 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Aug 2, 2019):

That's because the Terminal uses powershell as it's shell by default. You'd get the exact same error message in a powershell window as you're getting in the Terminal. The error message even tells you exactly what the problem is:

Windows Powershell does not load commands from the current location by default. .... Instead type ".\php"

You could also configure the terminal to launch cmd.exe by default instead of powershell. You can find info on how to do that here.

@zadjii-msft commented on GitHub (Aug 2, 2019): That's because the Terminal uses `powershell` as it's shell by default. You'd get the exact same error message in a `powershell` window as you're getting in the Terminal. The error message even tells you exactly what the problem is: ``` Windows Powershell does not load commands from the current location by default. .... Instead type ".\php" ``` You could also configure the terminal to launch cmd.exe by default instead of powershell. You can find info on how to do that [here](https://github.com/microsoft/terminal/blob/master/doc/user-docs/UsingJsonSettings.md).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#3070