第一次设置 VPS——注意不要在这里问,除非我做了尽职调查并提供了上下文。
在我的远程 VPS 上,通过终端,我运行的几乎所有命令都以一条Error: Too many open files消息结束,我需要您的帮助才能继续前进。
我CentOS Linux release 7.6.1810 (Core)在一台有 1 个 CPU 内核和 2048Mb RAM 的机器上运行。它已经设置了一个Nginx 1.16.1, PHP-FPM 7.3.9, MariaDb 10.4.8用于简单 wordpress 站点的 LEMP 堆栈。
我试过了:
中的系统范围设置/etc/security/limits.conf:
nginx soft nofile 1024
nginx hard nofile 65536
root hard nofile 65536
root soft nofile 1024
Run Code Online (Sandbox Code Playgroud)
调整内存限制和上传/etc/php.ini:
memory_limit = 256M
file_uploads = On
upload_max_filesize = 128M
max_execution_time = 600
max_input_time = 600
max_input_vars = 3000 …Run Code Online (Sandbox Code Playgroud)