Fatal error: Maximum execution time of 30 seconds exceeded in

Discussion in 'PHP' started by exinrex, Mar 30, 2008.

  1. #1
    Hello Guys,

    Need some help guys. I'm not really a programmer but i know little in programming. I wrote a script a simple script with 43 lines it's a simple script. but my problem is i got this error "Fatal error: Maximum execution time of 30 seconds exceeded in" sometimes it's gone and sometimes it's appear. Is the problem on this guys is my config of my php.ini or my script? thank's for help
     
    exinrex, Mar 30, 2008 IP
  2. Gordaen

    Gordaen Peon

    Messages:
    277
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #2
    With nothing to go one, I'd guess it's a problem with your script. You probably have an infinite loop or similar problem.
     
    Gordaen, Mar 30, 2008 IP
  3. pfek

    pfek Member

    Messages:
    98
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    45
    #3
    If you have access to your server's config there is a config called MAX_EXECUTION_TIME which is usually 30 seconds so it might be your problem. You can change it easily.

    Usually the script exceeds it's max time when you something unusual, like managing lots and lots of information or connection to an external server, mail for example. Might be a possibility there is an infinite loop in your program, so you will need to have a look by yourself! As we all know, no computer program can detect if there is an infinite loop in a code or something! (If you have such a program, get out of your drawer and revolutionnarize the computer's world)
     
    pfek, Mar 31, 2008 IP
  4. exinrex

    exinrex Active Member

    Messages:
    413
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    81
    #4
    thank's to all your reply guys. yes your right. my mistake is the variable that not really needed that cause to make the looping run longer. Thank's again.
     
    exinrex, Mar 31, 2008 IP
  5. wmtips

    wmtips Well-Known Member

    Messages:
    601
    Likes Received:
    70
    Best Answers:
    1
    Trophy Points:
    150
    #5
    If you need you can change max execution time per script basis, without config modifications:

    set_time_limit(90);
    PHP:
     
    wmtips, Mar 31, 2008 IP
  6. KorcanErgun

    KorcanErgun Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    use only set_time_limit(SECOND); function because if u up your max execution time on your php.ini you open the ways MAX CPU :)
     
    KorcanErgun, Mar 31, 2008 IP
  7. exinrex

    exinrex Active Member

    Messages:
    413
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    81
    #7
    wow that nice tips. I will list down that.thank's
     
    exinrex, Apr 1, 2008 IP