Jump to content

Start PHP file as a process


benphelps

Recommended Posts

root@server1 [~]# cd /home/phelps/public_html/botdev
root@server1 [/home/phelps/public_html/botdev]# php bot.php > /dev/null &
[1] 5044
root@server1 [/home/phelps/public_html/botdev]#

 

If I close putty here, it still shuts the script down.

so, when you do

root@server1 [~]# cd /home/phelps/public_html/botdev
root@server1 [/home/phelps/public_html/botdev]# php bot.php > /dev/null &
[1] 5044
root@server1 [/home/phelps/public_html/botdev]#

 

it works...but as soon as you close putty it stops working?

very odd...even though it's in the background it must still close the stream. i've never done a background IRC bot before...

 

you can try a cronjob...but you should have the script create a lockfile, that way  if another instance opens, you can check for the lock file, telling you if another process of it is already running

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.