SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    May 2006
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Long script question?

    Hello,

    I have a long script that basically downloads alot of files from a FTP server.

    How can I:

    a) Get it to "progressively" echo stuff rather then waiting for the whole script to complete then echo it all at once

    b) Stop it from timing out based on the settings in php.ini (Its not possible to just change php.ini)

    Thanks,

    Tom

  2. #2
    Worship the Krome kromey's Avatar
    Join Date
    Sep 2006
    Location
    Fairbanks, AK
    Posts
    1,621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    a) No sure-fire way to fix this, as it's dependent upon way too many things (including, but no limited to, your server software and your browser); flush is the best you'll do.

    b) set_time_limit
    PHP Code:
    set_time_limit(0); //never timeout
    set_time_limit(300); //5 minutes 
    I'd suggest if at all possible use a high timeout instead of none whatsoever, just so you don't end up with worker threads eating up CPU cycles for all eternity.
    PHP questions? RTFM
    MySQL questions? RTFM


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
  •