Re: EXEC and Windows
| From: | firepages | Date: | Sat, 18 May 2002 16:23:08 +0000 |
| Subject: | Re: EXEC and Windows | ||
| References: | 1 2 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-13855@lists.php.net to get a copy of this message | ||
try
exec('start c:\progra~1\swish-e\swish-e.exe -w test -f
C:/Progra~1/EasyPHP/www/atelier_dev/data/index.swish-e',$out);
will start a seperate process but may kickstart it for you, I find exec a
bit wobbly on windows depending on the .exe in hand so I more often than not
just create a batchfile with my command-line in it and then exec the bat
file, but then you get no returned value anyway :) , not knowing exactly
what your script is doing its hard to know how to help.
Regards,
Simon Wheeler
firepages
"Nicole Amashta" <430ntr3k@bellsouth.net> wrote in message
news:3CE52138.4060508@bellsouth.net...
> Hi,
>
> 'exec' will returm the last line of any output.
>
> The syntax is:
>
> <snip
> src="http://www.php.net/manual/en/function.exec.php">
>
> string exec ( string command [, string array [, int return_var]])
>
> </snip>
>
> If you include the second parameter, the contents of the output will be
> placed in the array, each line being an element in the array.
>
> <?php
> $lastline = exec( "$command", $resultsArray );
>
> ## print out the results, if any.
> for($i=0; $i < sizeof($resultsArray); $i++)
> {
> ## you have to echo out the
> ## results from each element
> ## of the array.
> echo $resultsArray[$i] . '<br>';
> }
> ?>
>
> HTH!
> Nicole Amashta
> www.aeontrek.com
>
> Bernard Florent wrote:
> > Hello
> >
> > I try to use EXEC function to execute a command line. The command line
is
> > correct but the exec doesn't return anything.
> >
> > Have you any idea about it ?
> >
> > I give you my source :
> >
> > exec('"c:\progra~1\swish-e\swish-e.exe" -w "test" -f
> > C:/Progra~1/EasyPHP/www/atelier_dev/data/index.swish-e',$out);
> >
> >
>