Can someone tell me the best way to run a PHP script and output content and errors to a text file (using nohup) using the unix shell?

link|improve this question
feedback

1 Answer

up vote 4 down vote accepted
/usr/bin/php script.php > script.out 2>&1 

I don't know why you'd want to use nohup but that would be

nohup /usr/bin/php script.php > script.out 2>&1 &

See the manual

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.