Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
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?
/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
Required, but never shown