Re: How to get exec() to display output from UNIX Shell Environemnt?
| From: | Scott Fletcher | Date: | Tue, 05 Aug 2003 21:41:42 +0000 |
| Subject: | Re: How to get exec() to display output from UNIX Shell Environemnt? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-158359@lists.php.net to get a copy of this message | ||
I have read the manual but haven't seen anything that work with system,
passthru, exec for this command code.
Here's the example that I use for exec() and curl with one example script
and it work.
--snip--
exec("curl -d \"$XP_ECALS_STR\" 2>&1 ".TARGET_URL, $result_array,
$res_code);
--snip--
But with this one, it doesn't work. As you can see, this is not really much
different from the 1st example.
--snip--
exec("curl -u \"$BASIC_AUTH\" -d \"$XML_REQ_STR\" 2>&1
".TARGET_URL,
$result_array, $res_code);
--snip--
Thanks,
Scott F.
"Reuben D. Budiardja" <reubendb@innovativethought.com> wrote in message
news:200308051740.46848.reubendb@innovativethought.com...
On Tuesday 05 August 2003 05:20 pm, Scott Fletcher wrote:
> Hi!
>
> How do I get the php function exec() to spit out the data from the
Unix
> Shell Environment onto the webpage? I mean, I can create a script in bash
> shell environment using the terminal on the Unix machine and it would spit
> out the background information from the O/S along with the shell script.
I
> can do that with cURL. So, for the PHP, I would need to use exec() but it
> only executed the script without a problem but no shell output from the
> unix shell onto the webpage. How can I do that? It is very helpful for
> troubleshooting purpose.
Use the second argument of exec(), or use system(), depending on your need.
Read The Manual for exec() and system(). It's pretty clear.
RDB
--
-------------------------------------------------
/"\ ASCII Ribbon Campaign against HTML
\ / email and proprietary format
X attachments.
/ \
-------------------------------------------------
Have you been used by Microsoft today?
Choose your life. Choose freedom.
Choose LINUX.
-------------------------------------------------