致命错误 - 打开的文件太多
我尝试在我的新机器中运行PHPUnit测试,我得到这个错误:
PHP 致命错误:未捕获的异常“UnexpectedValueException”,消息“RecursiveDirectoryIterator::__construct(/usr/lib/php/pear/File/Iterator):无法打开目录:打开的文件太多”在 /usr/lib/php/pear/File/Iterator/Factory.php:114
旧机器上的相同代码运行良好...
新机器环境: PHP 版本: PHP 5.3.21 (cli) 旧版本: PHP 5.3.14
每次输出 PHPUnit:
................EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 65 / 66 ( 98%)
E
Time: 34 seconds, Memory: 438.50Mb
There were 50 errors:
1) XXXXXXXXXXX
PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator::__construct(/usr/lib/php/pear/File/Iterator): failed to open dir: Too many open files' in /usr/lib/php/pear/File/Iterator/Factory.php:114