PHP Warning: include(/YOUR-WORKING-FOLDER/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php): Failed to open stream: Too many open files in /YOUR-WORKING-FOLDER/vendor/composer/ClassLoader.php on line 571
PHP Warning: include(): Failed opening '/YOUR-WORKING-FOLDER/vendor/composer/../guzzlehttp/guzzle/src/Exception/ConnectException.php' for inclusion (include_path='.:/usr/share/php') in /YOUR-WORKING-FOLDER/vendor/composer/ClassLoader.php on line 571
PHP Fatal error: Uncaught Error: Class "GuzzleHttp\Exception\ConnectException" not found in /YOUR-WORKING-FOLDER/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:210
$ cat /proc/YOUR_SCRIPT_PID/limit | grep -i 'max open files'
✅ Max open files 1024 1024 files
Workaround / Solution
Just increase the ulimit.
代碼:
$ vi /etc/security/limits.conf
# -------------------------------------
# ADD the following lines, increase the value from 1024 to "16384" or more
# -------------------------------------
* hard nofile 16384
* soft nofile 16384
root hard nofile 16384
root soft nofile 16384
$ reboot
$ cat /proc/YOUR_SCRIPT_PID/limit | grep -i 'max open files'
✅ Max open files 16384 16384 files