Results 1 to 4 of 4

Thread: How can i stop a PHP Script

  1. #1
    Join Date
    May 2009
    Posts
    258

    How can i stop a PHP Script

    I am having a PHP script that is gone annoying for me. It is doing a repetitive act several times or simply involves a lot of number crunching or similar. Also some times i am afraid it may get time out. How can i stop my PHP script getting time out ? Please help..

  2. #2
    Join Date
    Apr 2008
    Posts
    4,088

    Re: How can i stop a PHP Script

    First you should consider a manuscript that more than 30 seconds into place requires a suitable web server, but if there is a special instance where it is, or indeed if you have PHP on your local server / machine operation shall you can adjust the following settings:-

    <?php
    set_time_limit(500);//increase time out to 500 seconds
    ?>
    Also Flush the output buffer. Flushes the output buffers of PHP and whatever backend PHP is using (CGI, a web server, etc). This effectively tries to push all the output so far to the user's browser. flush() has no effect on the buffering scheme of your web server or the browser on the client side. Thus you need to call both ob_flush() and flush() to flush the output buffers. Several servers, especially on Win32, will still buffer the output from your script until it terminates before transmitting the results to the browser.

  3. #3
    Join Date
    Jan 2008
    Posts
    1,521

    Re: How can i stop a PHP Script

    I think you need to use use echo and flush.flush() has no effect on the buffering scheme of your web server.Even the browser may buffer its input before displaying it. Netscape, for example, buffers text until it receives an end-of-line or the beginning of a tag, and it won't render tables until the </table> tag of the outermost table is seen.

    Some versions of Microsoft Internet Explorer will only start to display the page after they have received 256 bytes of output, so you may need to send extra whitespace before flushing to get those browsers to display the page.

  4. #4
    Join Date
    May 2009
    Posts
    258

    Re: How can i stop a PHP Script

    Thanks mate for the quick help and sharing this valuable code. I increased the time out session to 500 and i hope it'll continue to work fine. Thank you again.

Similar Threads

  1. How to stop cross-site script in Internet Explorer 8?
    By Aaghaz in forum Technology & Internet
    Replies: 4
    Last Post: 17-02-2011, 10:32 AM
  2. want to stop auto generation of script on ajaxproject
    By KADRI in forum Software Development
    Replies: 4
    Last Post: 25-01-2010, 10:36 PM
  3. Word 2008 + bibfuse: no script in script menu
    By deval4u in forum Software Development
    Replies: 5
    Last Post: 06-04-2009, 12:53 PM
  4. Stop the execution of a script
    By leon m in forum Technology & Internet
    Replies: 3
    Last Post: 26-01-2009, 06:53 PM
  5. Replies: 2
    Last Post: 14-01-2009, 01:25 PM

Tags for this Thread

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
  •  
Page generated in 1,713,917,657.03386 seconds with 17 queries