Re: can't get output of exec ('nice -n 19 ffmpeg -i "file"')
| From: | Rene Veerman | Date: | Mon, 29 Sep 2008 19:09:08 +0000 |
| Subject: | Re: can't get output of exec ('nice -n 19 ffmpeg -i "file"') | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-281134@lists.php.net to get a copy of this message | ||
bingo, this fixed it :)
thx (all) for answering so quickly :)
Daniel Brown wrote:
Try this instead, just to make sure everything's running as expected:<?php $cmd = 'nice -n 19 ffmpeg -i "'.$sourcePath.'" 2>&1'; exec($cmd,$ret,$err); print_r($ret); ?>$ret (or whatever you name the second parameter of exec()) willalways be an array, regardless of the actual output from the command.You'll need to be sure you have shell access and the ability toexecute system commands as whatever user the PHP script is running (your own user, apache, httpd, nobody, daemon, pscln, etc.).Redirecting the error channel to stdout (using the 2>&1 redirectat the tail of the command) will also give you the full program response on $ret, which is then dumped in full using print_r() as shown above.