Installationphp7, if these parameters of php-fpm are set improperly, php-fpm will not be started, the nginx site will not be able to parse the php file, and a 404 error will be reported.
Related commands:
centos7, start php-fpm:
systemctl start php-fpm
Check whether php-fpm is started:
ps -ef|grep php
Core parameter configuration of php-fpm , the default is as follows:
pm = dynamic pm.max_children = 5 pm.start_servers = 2 pm.min_spare_servers = 1 pm.max_spare_servers = 3
Only for dynamic mode, the dynamic description is as follows:
max_children: limit the maximum number of php-fpm processes in dynamic mode
start_servers: in dynamic mode Starting number of php-fpm processes
min_spare_servers: The minimum number of php-fpm processes in the idle state in dynamic mode
max_spare_servers: The maximum number of php-fpm processes in the idle state in dynamic mode
If you pay attention to changing these parameters incorrectly, php-fpm will not be able to start, and nginx will not be able to access the php file. You can check the log to troubleshoot errors:
/usr/local/php/var/log/php-fpm.log
Rule summary:
1.max_children must be greater than min_spare_servers
2.max_children must be greater than max_spare_servers
3.start_servers must be greater than min_spare_servers
4.start_servers = min_spare_servers (max_spare_servers - min_spare_servers ) / 2
PS: My server has 8G memory, and there is still a lot of free space at the moment, so I added a 0 at the end, which are 50, 20, 10, and 30 respectively.
The above is the detailed content of php-fpm parameter configuration for php7+ (notes). For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Dreamweaver Mac version
Visual web development tools





