I have a program that only works on Linux, and I have my development environment on Windows.
When I run a WSL command from
cmdin Windows it works as expected.- When I run
C:\wsl echo "foo"incmd.exeI getfooback via stdout.
- When I run
When I run the same command from within php via
execI don't get any stdout output and get an exit code-1073740791which 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