"; passthru("$cmd 2>&1", $return_code); echo ""; if ($return_code) { http_response_code(500); echo "An error occurred!
See the data below
"; echo "The return code was $return_code
"; echo "Command:
$cmd
"; exit(); } ?> You can see the result here.