When I execute my command in PHP with shell_exec it always returns an empty string. I tried shell_exec(\'ls -l\'); and it works. I put the command as
shell_exec
shell_exec(\'ls -l\');
You may want to try " > file.txt 2>&1" at the end of your command. It will redirect the outputs to a separate file.
$command = "cmd command > outputs.txt 2>&1"; shell_execute($command);
You'll end up with a file that looks something like this:
b'cmd command output contents\r\n'