PHP SplFileInfo: "Too many open files"

Linux howto's, compile information, information on whatever we learned on working with linux, MACOs and - of course - Products of the big evil....

PHP SplFileInfo: "Too many open files"

Postby peter_b » Fri Mar 10, 2017 2:37 pm

[PROBLEM]
Storing clones of SplFileInfo objects in an array to sort them, throws the following error:
failed to open dir: Too many open files in [...]


[SOLUTION]
If only I had seen Ken Snyder's comment on PHP DirectoryIterator's documentation page before:
Don't store DirectoryIterator objects for later; you will get an error saying "too many open files" when you store more than the operating system limit (usually 256 or 1024).
  • 0

User avatar
peter_b
Chatterbox
 
Posts: 307
Joined: Tue Nov 12, 2013 2:05 am
Reputation: 3

Return to Knowledge Base

Who is online

Users browsing this forum: No registered users and 1 guest

Who is online over last 24 hours

Users browsed this forum in the last 24 hours: Bing [Bot] and 25 guests

cron
Reputation System ©'