Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2003
    Location
    India
    Posts
    109

    Unanswered: How do I avoid "Maximum execution time of 30 seconds exceeded" error

    Hi all,
    I am using imap_open function to open a stream to a mailbox.It works pretty well if I give the correct port , username,password and host details.But I want to make sure it has proper error handling mechanism as well. That is, If any user gives an invalid host or username , then I get this below error from php's default error handler

    Warning: imap_open(): Couldn't open stream {nbm/pop3:110}INBOX in c:\inetpub\wwwroot\helpdeskpilot\includes\generic. class.php on line 1092

    Warning: imap_open(): Couldn't open stream {nbm/pop3/notls}INBOX in c:\inetpub\wwwroot\helpdeskpilot\includes\generic. class.php on line 1095

    Fatal error: Maximum execution time of 30 seconds exceeded in c:\inetpub\wwwroot\helpdeskpilot\includes\generic. class.php on line 1095


    Now, I know how to suppress the warning message and I don't care about it as long as I can continue executing my script. What is worrying me most is the "fatal error" that I get here.I would like to avoid this error in the first case , and if at all it can't be avoided , I would like to continue with my script execution.Is this possible? If yes,any ideas how it can be done?

    Thanks & Regards,
    Celia.
    Last edited by rexselin; 09-14-05 at 07:28.

  2. #2
    Join Date
    Mar 2005
    Location
    Vienna, Austria
    Posts
    22
    Hi
    try
    ini_set("max_execution_time","n"); // to set the max. execution time to n seconds

    at the beginning of your script.

    Or change the default value in the php.ini file (if you were authorized to do so).
    The changing in the ini file affects ALL scripts on the server, the code line mentioned above affects only your script.

    Erich

    Have a bit more sun in your heart

Posting Permissions

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