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.


Update system config


Set fs.file-max to something like "65535", save and exit.


sudo nano /etc/sysctl.conf
fs.file-max=65535