I have a program that only works on Linux, and I have my development environment on Windows.
When I run a WSL command from
cmd
in Windows it works as expected.- When I run
C:\wsl echo "foo"
incmd.exe
I getfoo
back via stdout.
- When I run
When I run the same command from within php via
exec
I don't get any stdout output and get an exit code-1073740791
which I assume is an error.
Cmd.exe:
C:\wsl echo "foo"
foo
PHP:
<?php
$cmd = 'wsl echo "foo"';
exec($cmd, $out, $code);
dd($out, $code);
?>
// $out is []
// $code is -1073740791