PHP GENERAL 23 RE PHP IMAP HEADER TIMING OUT
Date: 08 Jul 2003 12:49:37 -0400

Subject: Re: [PHP] imap_header timing out
From: adam@no-spam (Adam Voigt)

Put:

set_time_limit(0);

At the top of your script.

On Tue, 2003-07-08 at 12:45, Amer Neely wrote:
> I've a script reading a mailbox using > $InBox = imap_open($Host,$User,$Pass);
> $NumMsgs=imap_num_msg($InBox);
> for ($i=1; $i <= $NumMsgs; $i++)
> {
> $Header=imap_header($InBox,$i); # this is line 154
> .
> .
> .
> and so on.
> > With 12 messages in the mailbox this works fine, but with 15 it comes > back as timed out...
> [08-Jul-2003 12:32:46] PHP Fatal error: Maximum execution time of 30
> seconds exceeded in g:\httpd\public\readmail\readmail.php on line 154
> > I'm running this at home (W2K/Apache/PHP 4.3.2) on a dialup account. Can > someone shed some light on why it may be timing out, and where do I > increase the timeout if needed? Or optimize the code if possible?
> > -- > /* All outgoing email scanned by AVG Antivirus /*
> Amer Neely, Softouch Information Services > W: www.softouch.on.ca > E: aneely@no-spam > Perl | PHP | MySQL | CGI programming for all data entry forms.
> "We make web sites work!"
-- Adam Voigt (adam@no-spam Linux/Unix Network Administrator The Cryptocomm Group

Date: Tue, 08 Jul 2003 18:07:09 +0100

Subject: Re: imap_header timing out
From: pete@no-spam (Pete Morganic)
see the set_time_limit(); function http://uk2.php.net/manual/en/function.set-time-limit.php
increase to around a minute or make the mailbox read them back in pages with 10 at a time for example
Pete
Amer Neely wrote:
> I've a script reading a mailbox using > $InBox = imap_open($Host,$User,$Pass);
> $NumMsgs=imap_num_msg($InBox);
> for ($i=1; $i <= $NumMsgs; $i++)
> {
> $Header=imap_header($InBox,$i); # this is line 154
> .
> .
> .
> and so on.
> > With 12 messages in the mailbox this works fine, but with 15 it comes > back as timed out...
> [08-Jul-2003 12:32:46] PHP Fatal error: Maximum execution time of 30
> seconds exceeded in g:\httpd\public\readmail\readmail.php on line 154
> > I'm running this at home (W2K/Apache/PHP 4.3.2) on a dialup account. Can > someone shed some light on why it may be timing out, and where do I > increase the timeout if needed? Or optimize the code if possible?
>