RE: Prevent error output from shell_exec

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You can also put an "@" before the actual DOS command to suppress it's
output ("@dir *.txt").  Between that, using the "@" on you PHP command
and "> NUL", I'd think you could get it to be quiet.  Sorry, don't have
time to test this for your ight now.  Let us know what you find.

-TG

> -----Original Message-----
> From: Paul J. Smith [mailto:pjsmith@xxxxxxxxxxxxxxx] 
> Sent: Saturday, May 22, 2004 6:16 PM
> To: Svensson, B.A.T. (HKG)
> Cc: php-windows@xxxxxxxxxxxxx
> Subject: RE:  Prevent error output from shell_exec
> 
> 
> I'm calling ps_exec.
> 
> 		$handle = popen($cmd);
> 		$read = fread($handle, 2096);
> 		echo $read;
> 		pclose($handle);
> 
> Does nothing whereas system($cmd) or shel_exec($cmd) works fine, apart
> from the output.  $read outputs nothing when I tested it.  
> When calling
> popen, can you pass program parameters such as "dir *.tmp /p" ?  Maybe
> this is why it's not working.  The $cmd I call has rather a lot of
> command line parameters to go with it.
>  
> 
> -----Original Message-----
> From: Svensson, B.A.T. (HKG) [mailto:B.A.T.Svensson@xxxxxxx] 
> Sent: 22 May 2004 22:59
> To: 'php-windows@xxxxxxxxxxxxx '
> Subject: RE:  Prevent error output from shell_exec
> 
> I can guarante you that popen() does work - I use it myself 
> on a win2003
> server. Since you can use shell_exec() I assume this has nothing to do
> with
> safe_mode being switched on.
> 
> How do you call popen() ands what kind of dos program are you calling?
> 
> 
> -----Original Message-----
> From: Paul J. Smith
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux