In the Windows environment, how to specify a terminal for the exec function?

because the production environment is a Linux system.

when testing the Shell task code I wrote in the Windows environment (such as merging videos, processing pictures, etc.), I always had to switch to the Windows command, and I was worried that something would go wrong in the Linux environment.

I found that Git"s native bash.ext can execute Linux commands, so I want to ask: how to make functions such as PHP"s exec_shell use this bash.exe, instead of cmd.exe when executing commands .

add: will this problem be solved if I run PHP in bash.exe and then execute the shell task? Who can tell me how to experiment, or test it for me?

< hr >

I have successfully replaced the PHPStorm terminal with bash.exe, but php.ini does not seem to have the relevant configuration, which is very confusing.

< hr > In the end,

didn"t happen either. Well, opening a single bash window doesn"t matter much.

Thank you for your help. See you next question, (XD).

Apr.01,2021

you install git directory: {git}

{git} / bin/sh.exe your script path


execute bash somePath.sh to


exec('bash ...');
Menu