Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a server with the current 5.3.x version installed. Since we are running a really simple and small server in php using sockets, that connects to a lot clients using sockets we need to raise the open file limit

that has been already done on the server for the user, that runs the server

#ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 29879
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 8192
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 29879
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

and we compiled php with


still we are getting

[19-Nov-2012 09:24:23 Europe/Berlin] PHP 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 1024.
--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.

once in a while in our logs. Anyone knows who to configure the unix server and php correctly to have that working?

I found a bug, but that is related to 2006 and marked as "not a bug"

share|improve this question
> Thanx. Changing the value inside usr/include/bits/ typesizes.h and > recompiling PHP fixed the problem. Did you try that? __FD_SETSIZE – user146104 Nov 19 '12 at 11:09
of course i tried that :) otherwise I would not have posted that ticket. The file does not exist anymore inside the php sources and I grepped for that line and did not find any output... – mlaug Nov 19 '12 at 11:14
mlaug, it would benefit everyone if you went back through your previous questions and accepted the best answer for each by clicking on the "tick" outline next to it. This drives the SF reputation system both for you and those who wrote the answers, and until you do, we see a big warning "0% accept rate" by your username. That may discourage others from spending any time answering your questions! – MadHatter Nov 20 '12 at 7:32
Confirmed this is still the default behaviour on 2015/12 with php 5.3.3. socket_select() gives error if over 1024 descriptors set. Maybe forking or multiple executables. – anttiR Dec 16 '15 at 12:09

See Practical maximum open file descriptors (ulimit -n) for a high volume system for how to raise the system limit. If your system limit is lower than PHP's compiled-in self-limit, then that might cause this problem.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.