kill process in PHP

Discussion in 'PHP' started by reza56, Apr 24, 2007.

  1. #1
    I have a script runs every 3 seconds by javascript refreshing. Sometimes that is crashing because some of older copies remain in memory and my server does not allowed rather than N runs of a script in one time. I want to bring out older copies of script from memory on first of every running of script. I can do it manually by KILL PROCESS in CPANEL but I am looking about an automatically solution.
     
    reza56, Apr 24, 2007 IP
  2. Weizheng

    Weizheng Peon

    Messages:
    93
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Mind sharing how you kill processes using CPanel?

    As for your problem, the simplest solution would be to set the time limit of the script to 3 seconds so that they'll auto terminate.
     
    Weizheng, Apr 25, 2007 IP
  3. MMJ

    MMJ Guest

    Messages:
    460
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #3
    http://www.php.net/manual/en/function.shell-exec.php#57215

    http://www.google.com/search?q=kill+process+in+PHP

    --

    Remember Google is you friend! :)
     
    MMJ, Apr 25, 2007 IP
  4. Weizheng

    Weizheng Peon

    Messages:
    93
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    That guy said he uses CPANEL.

    exec is a php function.
    kill is a unix command

    Both are usually disable in shared hosting.
     
    Weizheng, Apr 25, 2007 IP
  5. MMJ

    MMJ Guest

    Messages:
    460
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Who are you talking to? :confused:
     
    MMJ, Apr 25, 2007 IP
  6. reza56

    reza56 Active Member

    Messages:
    92
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #6
    I am using "Process Manager" in CPANEL.
     
    reza56, Apr 26, 2007 IP