I'm trying to execute a .exe file form PHP.
I've set the PATH variable and confirmed that it works by running my command from random directory.
PHP code:
$command = "myCommand >> log.txt 2>&1";
echo exec($command, $output, $return)."<br>";
I've inspected the log.txt and it contains an error:
'myCommand' is not recognized as an internal or external command,
operable program or batch file.
What could be the reason for this issue? it seems that PHP won't look into all directories specified inside of PATH. What do you recommend that I do?
Specifying full path to myCommand
works, but I'd like to omit it. I am running Windows 10.