user1197941
user1197941

Reputation: 179

imap_open fails giving Unable to create selectable TCP socket

I have the following code

$mbox = imap_open("{mail.mydomain.com:143/imap/notls}INBOX", "[email protected]","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?

Upvotes: 1

Views: 1523

Answers (1)

Max
Max

Reputation: 10985

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.

Upvotes: 1

Related Questions