note 88621 added to function.shell-exec
| From: | dburles at NOSPAMgmailDOTcom | Date: | Sun, 01 Feb 2009 11:07:02 +0000 |
| Subject: | note 88621 added to function.shell-exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-150055@lists.php.net to get a copy of this message | ||
Easy way to capture error output in windows
// we'll execute a php script as an example:
$out = shell_exec("php test.php 2> output");
print $out ? $out : join("", file("output"));
We assume in this case if the script produces output it has ran ok, the $out variable will then
contain the output, if $out is empty then we read the captured error output from a file simply
called 'output'.
Hope this helps someone
----
Server IP: 117.104.160.194
Probable Submitter: 220.237.42.107
----
Manual Page -- http://www.php.net/manual/en/function.shell-exec.php
Edit -- https://master.php.net/note/edit/88621
Del: integrated -- https://master.php.net/note/delete/88621/integrated
Del: useless -- https://master.php.net/note/delete/88621/useless
Del: bad code -- https://master.php.net/note/delete/88621/bad+code
Del: spam -- https://master.php.net/note/delete/88621/spam
Del: non-english -- https://master.php.net/note/delete/88621/non-english
Del: in docs -- https://master.php.net/note/delete/88621/in+docs
Del: other reasons-- https://master.php.net/note/delete/88621
Reject -- https://master.php.net/note/reject/88621
Search -- https://master.php.net/manage/user-notes.php