#37025 [Opn->Fbk]: FD_SETSIZE error
ID: 37025
Updated by: tony2001@php.net
Reported By: linuxapps at yahoo dot com
-Status: Open
+Status: Feedback
Bug Type: Sockets related
Operating System: Fedora Core 4
PHP Version: 5.1.2
New Comment:
What is the value of __FD_SETSIZE in /usr/include/bits/typesizes.h ?
Previous Comments:
------------------------------------------------------------------------
[2006-04-09 21:52:02] linuxapps at yahoo dot com
Correction. Bug appears in CLI and CGI modes.
------------------------------------------------------------------------
[2006-04-09 16:59:29] linuxapps at yahoo dot com
Description:
------------
When compiled with --disable-cgi, PHP CLI throws an
error on socket_select() when socket count > 1024.
It appears that the CLI installation defaults to
FD_SETSIZE=1024 regardless of what is set at compile
time via --enable-fd-setsize. PHP CGI, however, works
properly.
This error happens identically to both sockets and
socket streams (e.g. stream_select()). The code example
uses sockets.
Reproduce code:
---------------
http://fourthround.com/bugs/server.txt
http://fourthround.com/bugs/stester.txt
Expected result:
----------------
As long as the OS's open file limit has not been
exceeded PHP CLI should not throw an error when compiled
with --enable-fd-setsize=4096 and socket_select on over
1024 sockets.
Actual result:
--------------
Warning: socket_select(): You MUST recompile PHP with a
larger value of FD_SETSIZE. It is set to 1024, but you
have descriptors numbered at least as high as 1054. --
enable-fd-setsize=2048 is recommended, but you may want
to set it to equal the maximum number of open files
supported by your system, in order to avoid seeing this
error again at a later date.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37025&edit=1
Thread (5 messages)