01/11/2014 - LINUX
This error often occurs when running a PHP application in terminal and related to limitation on the server. To solve the problem do the following.
Set fs.file-max
to something like "65535", save and exit.
sudo nano /etc/sysctl.conf
fs.file-max=65535