0

This question shows how to run a persistent PHP script. However, is there a way to also write the output to a text file? I've tried running nohup php hello_world.php & > &1 > output.txt, but I get syntax error near unexpected token '&'. If I remove the &, the output is logged, but the script only runs once. Thanks.

Community
  • 1
  • 1
Impossibility
  • 954
  • 7
  • 20

1 Answers1

0

Try this:

nohup php hello_world.php > output.txt &
mihutz
  • 195
  • 1
  • 3
  • 11