ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-dev
php-dev
#37025 [Fbk->Opn]: FD_SETSIZE error
by Linuxapps At Yahoo Dot Com other posts by this author
Apr 10 2006 5:54AM messages near this date
#37025 [Opn->Bgs]: FD_SETSIZE error | #37025 [Opn->Fbk]: FD_SETSIZE error
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] tony2001@[...].net

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
Thread:
Linuxapps At Yahoo Dot Com
Linuxapps At Yahoo Dot Com
Linuxapps At Yahoo Dot Com
tony2001
Linuxapps At Yahoo Dot Com

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved