note 90176 added to function.shell-exec
| From: | joelhy at osu1 dot php dot net | Date: | Thu, 09 Apr 2009 01:29:00 +0000 |
| Subject: | note 90176 added to function.shell-exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-152986@lists.php.net to get a copy of this message | ||
Here is a easy way to grab STDERR and discard STDOUT:
add '2>&1 1> /dev/null' to the end of your shell command
For example:
<?php
$output = shell_exec('ls file_not_exist 2>&1 1> /dev/null');
?>
----
Server IP: 69.147.83.197
Probable Submitter: 218.5.2.219
----
Manual Page -- http://www.php.net/manual/en/function.shell-exec.php
Edit -- https://master.php.net/note/edit/90176
Del: integrated -- https://master.php.net/note/delete/90176/integrated
Del: useless -- https://master.php.net/note/delete/90176/useless
Del: bad code -- https://master.php.net/note/delete/90176/bad+code
Del: spam -- https://master.php.net/note/delete/90176/spam
Del: non-english -- https://master.php.net/note/delete/90176/non-english
Del: in docs -- https://master.php.net/note/delete/90176/in+docs
Del: other reasons-- https://master.php.net/note/delete/90176
Reject -- https://master.php.net/note/reject/90176
Search -- https://master.php.net/manage/user-notes.php