I found that a script I was running was calling some linux functions using exec() but they weren’t always successful and I couldn’t tell why.

exec('command to run');

This would fail silently

$result = exec('command to run 2>&1', $output);

This would correctly send me back the result (in $result) and then I could do whatever with the error(s)

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.