Hello together,
Starting a PHP script using putty, e.g. /opt/lampp/bin/php my_script.php & and closing this putty session, unfortunately closes the started script.
How can I avoid that, since I want to run a few scripts on different internal webservers, but don't want to leave the shell windows open?
Thanks for your help,
visionmaster
Putty and starting PHP scripts via shell
Moderator: General Moderators
-
visionmaster
- Forum Contributor
- Posts: 139
- Joined: Wed Jul 14, 2004 4:06 am
Code: Select all
/opt/lampp/bin/php my_script.php >/dev/null 2>&1 &-
visionmaster
- Forum Contributor
- Posts: 139
- Joined: Wed Jul 14, 2004 4:06 am
Thanks for your response. That doesn't work, closing the ssh windows also shuts down the running script.redmonkey wrote:Code: Select all
/opt/lampp/bin/php my_script.php >/dev/null 2>&1 &
The command "screen" seems to be the thing I'm looking for.
You can force the process to continue executing after you logout or close the terminal windor by prefixing your command with the nohup statement and executing it in the background:
Any output from the process which would normally be sent to the terminal is written to nohup.out in the directory the process was launched from.
Check out http://wiki.linuxquestions.org/wiki/Nohup for more info about nohup.
Code: Select all
nohup command &Check out http://wiki.linuxquestions.org/wiki/Nohup for more info about nohup.