I'm trying to use the PHP passthru function to execute an OS command on Linux.
I am using it as follows. The Linux command is just to list files in a directory I know does not exist and then I am just echoing the status to make sure it's not 0.
$osexec = "ls /tp";
$status = 0;
$result = passthru($osexec, $status);
echo $status;
However the status seems to be the entire output of the command including the status number
ls: /tp: No such file or directory
2
Why is this?