note 36145 added to ref.exec
| From: | jeremy at ntb dot co dot nz | Date: | Sun, 28 Sep 2003 13:18:40 +0000 |
| Subject: | note 36145 added to ref.exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-57210@lists.php.net to get a copy of this message | ||
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.
----
Manual Page -- http://www.php.net/manual/en/ref.exec.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+36145
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+36145&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+36145&report=yes