Execute in background

Discussion in 'PHP' started by Triexa, May 19, 2007.

  1. #1
    I'm quite sure I've asked a very similar question, but I just can't seem to make my thing work...

    I am going to execute a script through cron. When it is complete, I want it to execute itself again (then current one will die) in the background.

    How do I make it run in the BACKGROUND instead of the first one waiting for the output of the second execution to finish?
     
    Triexa, May 19, 2007 IP
  2. sky22

    sky22 Guest

    Messages:
    59
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hello

    You could try:

    exec('/usr/bin/php phpfile.php >/dev/null &');
     
    sky22, May 19, 2007 IP
  3. DeViAnThans3

    DeViAnThans3 Peon

    Messages:
    785
    Likes Received:
    83
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Of course, that requires that Safe Mode is on :)
    But it is a very good method.
    I just found another thread handling about this here.
     
    DeViAnThans3, May 20, 2007 IP