Link to home
Start Free TrialLog in
Avatar of Geoff Millikan
Geoff MillikanFlag for United States of America

asked on

PHP5 > passthru() > Redirecting output to a file?

At the link below, the PHP manual says that "Note: If you start a program using this function and want to leave it running in the background, you have to make sure that the output of that program is redirected to a file or some other output stream or else PHP will hang until the execution of the program ends."

Could someone post a simple example of how to redict output to a file using the passthru() function?

Thanks!

http://us3.php.net/manual/en/function.passthru.php

http://www.t1shopper.com/
Avatar of ravenpl
ravenpl
Flag of Poland image

passthru("the_command with params 2>/dev/null 1>/some/file &");
where 2 means stderr and 1 means stdout
Avatar of Geoff Millikan

ASKER

Sorry, I'm on Windows...  Can you try that example again in Bill Gates jargon...
ASKER CERTIFIED SOLUTION
Avatar of ravenpl
ravenpl
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial