imap_open fails giving Unable to create selectable

2019-02-28 15:42发布

问题:

I have the following code

$mbox = imap_open("{mail.mydomain.com:143/imap/notls}INBOX", "newsletter@mydomain.com","xxxxxxx");

 if ($mbox)
 {
  echo "connected";
  imap_close($mbox);
 }
 else
 {
  echo "not connected :<br>" . imap_last_error();
 }

It give this output

   not connected :
   Unable to create selectable TCP socket (1919 >= 1024)

I am able to telnet to the domain, using telnet mail.mydomain.com 443

   A LOGIN username password
   A OK LOGIN Ok

What is wrong with my PHP code?

回答1:

It appears PHP must be recompiled with a larger FD_SETSIZE. It appears to be mismatched to your system. Your system returns handle larger than 1024, but PHP thinks socket handles can only go up to 1024.



标签: php imap