Page 1 of 1

running a server continually????

Posted: Tue Jun 07, 2005 11:39 am
by amir1981
hi! i wrote a proxy server whith php,which should run continully
i run it by cli (with #!/user/bin/php -q) and also i use the cammand
set_time_limit(0); but after a while ,the server shutdown it!!!
i try to use cron job to run it(for example for every minute)but it doesn't
work!!! what is the problem?why the cron dosen't work?
is it any way to acheive this work?

Posted: Tue Jun 07, 2005 12:13 pm
by timvw
If you start something in a shell... it will only run as long as you are logged in (More or less...)

If your host allows it:

The easiest:
php -q "whateverscript.php" & will make the script run in the background.

Another option is to use "screen" and after you've started the script detach and log out.