Reputation: 153
I run a php script through shell using the following:
php script.php
How do I type this command in order to run it on the background and also log the output to a file?
I've tried
php script.php 2>&1 > out.log
But once I close putty, the script stopped.
Upvotes: 2
Views: 2478
Reputation: 5749
you can use nohup (no hang up)
nohup php script.php 2>&1 > out.log
or you use cron or at to run your script in background
Upvotes: 2