imap_open fails giving Unable to create selectable

2019-02-28 15:53发布

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?

标签: php imap
1条回答
唯我独甜
2楼-- · 2019-02-28 16:23

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.

查看更多
登录 后发表回答