Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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