note 36145 deleted from ref.exec by cmb

From: Date: Sun, 24 Feb 2019 09:30:35 +0000
Subject: note 36145 deleted from ref.exec by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-210284@lists.php.net to get a copy of this message
Note Submitter: jeremy at ntb dot co dot nz ---- If an error occurs in the code you're trying to exec(), it can be challenging to figure out what's going wrong, since php echoes back the stdout stream rather than the stderr stream where all the useful error reporting's done. The solution is to add the code "2>&1" to the end of your shell command, which redirects stderr to stdout, which you can then easily print using something like print shellcommand 2>&1.

« previous php.notes (#210284) next »