PHP Exec debugging
easy way of catching and displaying errors and return values from a exec() command back in PHP.
Copy this code and paste it in your HTML
exec("java -jar some command 2>&1 &", $return, $code); if ($code != 0) {
printf("Fuck! Something went wrong: %s (%s)", join('<br />', $return), $code); } else {
print("Command successful.");
}
Report this snippet
Comments
Subscribe to comments