Forum Moderators: coopster

Message Too Old, No Replies

PHP: imap_open Works Intermittently

fails with no error for hours at a time

         

Dolemite

8:53 am on May 27, 2003 (gmt 0)

10+ Year Member



The php function imap_open seems to work fine for me for a while, and then stops working for several hours.

This line of code is doing it:

$inbox = imap_open('{localhost:143}INBOX', 'username', 'password');

And no, I'm not actually using 'username' and 'password'. ;)

I'm running PHP 4.3.1 compiled with the imap c-Client. I've also tried using imap_open with pop3 protocol, which doesn't solve the problem. I also can't get imap_open to return an error as long as the variables are valid, even with "or die(...." statements. The status of the mailbox (full, empty...) seems to be irrelevent. I've tried mail.mydomain.com for server name, IPs, etc.

So since my code works sometimes, I think the fault is either with PHP or the server. I've noticed that loading my test page that runs this code on Netscape makes the browser try to keep connecting/reloading, while IE6 just gives a DNS error. I can strip my code down to that one line and it acts the same.

So, any ideas?

jatar_k

3:21 am on May 28, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



interesting, I'm not familiar enough with imap_open, since i don't use it.

Have you tried to get it to return an error with error_reporting (E_ALL); [ca3.php.net].

I can't think of anything else really. The intermittent problems are the worst.