ID:               37025
 User updated by:  linuxapps at yahoo dot com
 Reported By:      linuxapps at yahoo dot com
-Status:           Feedback
+Status:           Open
 Bug Type:         Sockets related
 Operating System: Fedora Core 4
 PHP Version:      5.1.2
 New Comment:

Exactly 1024!

/* Number of descriptors that can fit in an `fd_set'.  
*/
#define __FD_SETSIZE            1024


Previous Comments:
------------------------------------------------------------------------

[2006-04-09 21:59:41] [EMAIL PROTECTED]

What is the value of __FD_SETSIZE in /usr/include/bits/typesizes.h ?

------------------------------------------------------------------------

[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

Reply via email to