1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

.php scripts running more than max_execution_time

Discussion in 'Apache' started by postcd, Aug 8, 2015.

  1. #1
    Hello,

    on my webserver (Apache, php) i have like 32 seconds max execution time, but my firewall (config server firewall) reporting processes that running more than 100 seconds. I want to ask why these processes are not killed by apache after 32 seconds from execution? Can i anyhow change this using free software/tools? Why actually there is above mentioned php variable while scripts running longer than that?

    i found also an Apache directive called "Timeout"
     
    Last edited: Aug 8, 2015
    postcd, Aug 8, 2015 IP
  2. TheSHosting

    TheSHosting Member

    Messages:
    24
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    48
    #2
    What types of script they are? Are they forking from command line ( like using a cron job ) or scripts running via a web access?
     
    TheSHosting, Aug 20, 2015 IP
  3. postcd

    postcd Well-Known Member

    Messages:
    1,037
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    190
    #3
    TheSHosting: these looks like an publicly accessible scripts, not cronjobs. For example websites root index.php or an submission page submit.php etc.
     
    postcd, Aug 20, 2015 IP
  4. samirj09

    samirj09 Well-Known Member

    Messages:
    335
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    125
    #4
    With the max_execution_time, although, the execution time starts when PHP has completed the interpretation of the script and ends when the last statement has executed, the tasks that an operating system and the PHP interpreter has to do are not counted in the execution time.

    Additionally, external commands run using system or exec do not count towards the execution time. So even though your max_execution time is 32 seconds, a php process could technically run for longer.

    CSF has a built in option that allows you to automatically have processes exceeding a certain time limit killed. Use caution when enabling this though as it can cause unintended processes to be killed when configured incorrectly.
     
    samirj09, Aug 28, 2015 IP
    postcd likes this.