SitePoint Sponsor

User Tag List

Results 1 to 14 of 14
  1. #1
    3MTA3
    Join Date
    Jul 2003
    Location
    Florida
    Posts
    1,016
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CGI Timeout when running script on local server (IIS)

    I'm running a php script locally on an IIS server (Win XP) but keep getting this error even though I've increased the max execution times and memory to run scripts on php.ini:

    HTTP/1.1 502 Gateway Error Server: Microsoft-IIS/5.1 Date: Thu, 02 Dec 2004 18:15:28 GMT Connection: close Content-Length: 186 Content-Type: text/html
    CGI Timeout
    The specified CGI application exceeded the allowed time for processing. The server has deleted the process.
    Any suggestions?

  2. #2
    3MTA3
    Join Date
    Jul 2003
    Location
    Florida
    Posts
    1,016
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are there any CGI settings that can be changed in IIS?

  3. #3
    SitePoint Wizard bronze trophy
    Join Date
    Oct 2001
    Location
    Vancouver BC Canada
    Posts
    2,017
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    No I think it's all handled in the ini file.

    What are you trying to do with your script that requires a long timeout?
    Andrew Wasson | www.lunadesign.org
    Principal / Internet Development

  4. #4
    3MTA3
    Join Date
    Jul 2003
    Location
    Florida
    Posts
    1,016
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    spidering websites

  5. #5
    SitePoint Wizard bronze trophy
    Join Date
    Oct 2001
    Location
    Vancouver BC Canada
    Posts
    2,017
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Ok... That would take a while. I've done that in PERL but never had a problem with timing out.

    I did a mailer in PHP that would time out under huge loads of email addresses so I cycled it and mailed out batches of 25 emails at a time. Each time I refreshed the page with a progress report.

    Maybe you could do something similar with your spider script. Have it return a certain number of URL's it has spidered, keep track of where it is in its job, then go back and do another set of URL's.

    I'm afraid I can't think of anything else to help out.

    Andrew
    Andrew Wasson | www.lunadesign.org
    Principal / Internet Development

  6. #6
    3MTA3
    Join Date
    Jul 2003
    Location
    Florida
    Posts
    1,016
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by awasson
    Maybe you could do something similar with your spider script. Have it return a certain number of URL's it has spidered, keep track of where it is in its job, then go back and do another set of URL's.
    If I can't find a better way, then that should work for me. Thanks

  7. #7
    SitePoint Wizard bronze trophy
    Join Date
    Oct 2001
    Location
    Vancouver BC Canada
    Posts
    2,017
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    No worries and good luck with it.

    Andrew
    Andrew Wasson | www.lunadesign.org
    Principal / Internet Development

  8. #8
    3MTA3
    Join Date
    Jul 2003
    Location
    Florida
    Posts
    1,016
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I still keep getting the cgi timeout. Is there anyone here that can help with this?

  9. #9
    3MTA3
    Join Date
    Jul 2003
    Location
    Florida
    Posts
    1,016
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone?

  10. #10
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,576
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Can you run the script from the command line? I had a mail script that could take upwards of 12 hours to run. No fun from web, worked real good from a dos prompt.

    Another option is to continually flush output to the browser, thereby not seeming like a timeout.

  11. #11
    3MTA3
    Join Date
    Jul 2003
    Location
    Florida
    Posts
    1,016
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I thought about creating a .bat file and setting that to run, but it's currently setup to display info in the browser after it runs.

    I'll try flushing the output.

    Thanks

  12. #12
    3MTA3
    Join Date
    Jul 2003
    Location
    Florida
    Posts
    1,016
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, so what's the best way to continually flush output to the browser? I tried using flush() inside the loop, but it's not working...

    Anyone have experience with this?

  13. #13
    SitePoint Wizard bronze trophy
    Join Date
    Oct 2001
    Location
    Vancouver BC Canada
    Posts
    2,017
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by devised
    Ok, so what's the best way to continually flush output to the browser? I tried using flush() inside the loop, but it's not working...

    Anyone have experience with this?
    Hmmm that would be nice but I've always had to devise my own method.

    I usually start looping until I reach a predetermined number that I know can be achieved before time-out. I then set a variable to keep my place in the job, output the percentage of work done to the screen and continue on with the job.
    Andrew Wasson | www.lunadesign.org
    Principal / Internet Development

  14. #14
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,576
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    One thing to watch out for regarding flush: IE requires enough characters (256) in order to accept the output. So add a little pad with spaces function and you will be good to go.


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
  •