SitePoint Sponsor

User Tag List

Results 1 to 9 of 9

Thread: 30 sec timeout

  1. #1
    SitePoint Evangelist jkh1978's Avatar
    Join Date
    May 2001
    Location
    Northern Virginia
    Posts
    445
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    30 sec timeout

    My script times out in 30 seconds. This isnt a script that will be run often, so I dont mind that its slow. But it doesnt finish. Where is the 30 seconds scored? Is that a parameter I can change? Its not my server, so is there a way to override the timeout value without changing system properties? without compiling?

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    At the top of your script.

    PHP Code:
    set_time_limit(300); 
    where 300 is the number of seconds you want the timeout to be set at.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's in the php.ini, but you can use set_time_limit()
    http://www.php.net/manual/en/functio...time-limit.php

    Sean

    [edit]Typing as you posted
    Last edited by seanf; Dec 21, 2001 at 16:25.
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  4. #4
    SitePoint Addict itsource's Avatar
    Join Date
    Jun 2001
    Location
    Thailand
    Posts
    369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What benefit of this function, Should I set_time_limit() in my php script?
    I live in Thailand. My English grammar not well.

  5. #5
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by itsource
    Should I set_time_limit() in my php script?
    only if you NEED to like this guy did. for most any script, 30 seconds should be plenty. only set it higher if your script is doing something that's going to take longer than 30 seconds.
    - Matt ** Ignore old signature for now... **
    Dr.BB - Highly optimized to be 2-3x faster than the "Big 3."
    "Do not enclose numeric values in quotes -- that is very non-standard and will only work on MySQL." - MattR

  6. #6
    SitePoint Guru
    Join Date
    Dec 2000
    Location
    Karachi, Pakistan
    Posts
    913
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Or you can change it to:

    PHP Code:
    set_time_limit(0
    So that the page would finish only when the given task is completed.



    -Omair
    36Host.com - $36/year web hosting [affiliates earn 30%]
    * Affordable Small Business Web Hosting since 2003! *
    "500mb space, 10gb bandwith, 50 pop/ftp accounts, php,
    mysql, pre-installed php scripts, 24/7 support & more...."



  7. #7
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Omair did you test that tbefore posting it? I know that doesn't work, it just nulls the set_time_limit() function and defaults to whatever is in the ini file, I believe.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  8. #8
    SitePoint Guru
    Join Date
    Dec 2000
    Location
    Karachi, Pakistan
    Posts
    913
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Freddy,

    I have the PHP Manual, from where I learn all this stuff . Here is a quote from it regarding the topic.

    Set the number of seconds a script is allowed to run. If this is reached, the script returns a fatal error. The default limit is 30 seconds or, if it exists, the max_execution_time value defined in the configuration file. If seconds is set to zero, no time limit is imposed.

    I have'nt tested it though. But I can test it if you want me to.


    -Omair
    36Host.com - $36/year web hosting [affiliates earn 30%]
    * Affordable Small Business Web Hosting since 2003! *
    "500mb space, 10gb bandwith, 50 pop/ftp accounts, php,
    mysql, pre-installed php scripts, 24/7 support & more...."



  9. #9
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No need, I missed that in the manual, I just swear that I tried it the other day and it didn't work I haad to set a number but I am prolly wrong. If I feel up to it I might run a test later, but for now I will go with (0) sets no time limit.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •