shell - Redirection in PHP exec call creates empty file -


it's quite simple, , i'm out of ideas. i'm sure there quick workaround.

exec('echo 123 &> /var/log/123.log'); 

i'm sure it's not permissions, because file 123.log created, it's just- empty. i've tried shell_exec, doesn't create file @ all. tried variants of redirection, i.e. 1> 2> >.

using php capture output not option, output in production huge, , don't want run memory issues.

any ideas appreciated.

btw, i'm using ubuntu 12.04 lamp.

try shell_exec without &:

echo shell_exec("echo 123 > /var/log/123.log"); 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -