This article mainly explains the php-under Linux
FPMSome important parameters of the Chinese detailed description, and detailed introduction of the php-
FPMIntroduction to performance-related parametric optimizations Let's take a look at php-
FPMA performance-related introduction.
php-fpm.conf Important Parameters Detailed
PID = Run/php-fpm.pid#pid设置, the default is var/run/php-fpm.pid in the installation directory, it is recommended to turn on
Error_log = Log/php-fpm.log#错误日志, Var/log/php-fpm.
The version after fastcgi:php-5.3.3 comes with the FPM component,The FPM component enables the PHP interpreter to work as a daemon and provides an application similar to the Prefork mode that can receive FASTCGI server from the front-end httpd,http-proxy-fcgi reverse proxy user to the backend for dynamic content requestsThere are a few areas to note when building a split lamp:1. Dynamic resources are deploy
After loading nginx and php-5.5, configure the Nginx to invoke PHP and start php-fpm.
Use the following command
Copy Code code as follows:
/usr/local/php/sbin/php-fpm
You can start it up.
Create a PHP detection script in the Nginx directory index.php
Results in opening http://localhost/index.php
The discovery of tragedy cannot be opened. View the log file and see the reason for th
The 1 FPM (FastCGI process Manager) replaces most of the additional features of PHP FastCGI and is useful for high-payload sites.Its features include:Support Smooth stop/ start advanced process management function, can work on different uid/gid/" slow log " -- Special features: Used to continue to perform time-consuming work in the background (input video conversion, statistical processing, etc.) after the request completes and refreshes the data; dy
(persistent connection) can work.fastcgi of the poorBecause it is multi-process, so consumes more server memory than CGI multithreading, php-cgi interpreter consumes 7 to 25 megabytes per process, multiplying this number by 50 or 100 is a large amount of memory.Nginx 0.8.46+php 5.2.14 (FastCGI) server under 30,000 concurrent connection, open 10 Nginx process consumes 150M memory (15M10=150m), open 64 php-cgi process consumes 1280M memory (20M 64=1280m), combined with the memory consumed by the
Nginx itself can not handle PHP, it is just a Web server, when the request is received, if it is a PHP request, then sent to the PHP interpreter processing, and the results returned to the client.
Nginx is generally the request to send fastcgi management process processing, FASCGI management process Select the CGI subprocess processing results and return to be Nginx
This article takes php-fpm as an example to explain how to make Nginx support PHP
I. C
The configuration of LNMP or LNAMP environment is not described here, only the process of configuring multiple instances on the basis of a LNMP environment. Because I am using the lnamp environment, I compile an extra copy of PHP to/usr/local/php-fpm/, configuration file in/etc/php-fpm/, and make notes on this basis.
Modify three values First:1, in static mode, that is, the number of fixed processes runnin
, like this:
1234567
location ~ \. PHP$ { Index index. PHP index. HTML index. HTM; include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index. PHP; include fastcgi_params; }
The second step, edit the php-fpm configuration file/etc/php5/fpm/pool.d/www.confModify the Listen parameter to 127.0.0.1:9000, like this:
To agree on several directories
/usr/local/php/sbin/php-fpm/usr/local/php/etc/php-fpm.conf/usr/local/php/etc/php.iniI. PHP-FPM startup parameters
#测试php-FPM Configuration/usr/local/php/sbin/php-fpm-t/usr/local/php/sbin/php-fpm-c/usr/local/php/etc/php.ini-y/usr/local/php/et
Deep understanding based on php-fpm parameters. Psaux | grepphp-fpm | more View php-fpm total number php-fpm.conf configure pidstringPID file location. default is empty. error_logstring error log location. default: Installation Path # INSTA
Ps aux | grep php-fpm | moreView the total number of php-
This paper mainly explains some important parameters of PHP-FPM under Linux, and introduces in detail the PHP-FPM parameter optimization of performance.
php-fpm.conf Important Parameters Detailed
PID = Run/php-fpm.pid#pid设置, the default is var/run/php-fpm.pid in the installation directory, it is recommended to turn on
Error_log = Log/php-fpm.log#错误日志, Var/log/php-fpm.log in the installation directory by de
Nginx itself cannot handle PHP, it is just a Web server, when the request is received, if it is a PHP request, then sent to the PHP interpreter processing, and return the results to the client.Nginx is generally the request to send fastcgi management process processing, FASCGI management process Select the CGI sub-process processing results and return to the NginxThis article takes php-fpm as an example to explain how to make Nginx support PHPFirst, c
Nginx itself cannot handle PHP, it is just a Web server, when the request is received, if it is a PHP request, then sent to the PHP interpreter processing, and return the results to the client.Nginx is generally the request to send fastcgi management process processing, FASCGI management process Select the CGI sub-process processing results and return to the NginxThis article takes php-fpm as an example to explain how to make Nginx support PHPFirst, c
This article mainly introduces the PHP-FPM boot automatic shell script, this article script is just an example, in fact, you compile the installation completed, the startup script has been generated in the compilation directory, only need to copy out to use on it, need friends can refer to the
Online there are various versions of the PHP-FPM boot automatic script, in fact, you compiled the source directory
PHP-FPM currently has two branches, which correspond to the php-5.2.x version and the php-5.3.x version. In the 5.2.x version, php-fpm.conf uses XML format, and in the new 5.3.x version, it is the same configuration style as php.ini.1.PHP-FPM provides a slow execution log that can dump the calling process of a slow script into the log.PHP 5.3.3 is set up as follows:After PHP 5.3.3, set the following as foll
[Switch] what are CGI, FastCGI, PHP-CGI, PHP-FPM, and Spawn-FCGI? Reprinted from:
Http://hi.baidu.com/fxchby/blog/item/c041ef0d6c510bf3aa6457dd.html
Http://www.mike.org.cn/articles/what-is-cgi-fastcgi-php-fpm-spawn-fcgi/
What is CGI?
CGI is a Common Gateway Interface. it is a tool for the HTTP server to "talk" with programs on your or other machines, the program must run on the network server.
CGI
The lnmp environment installed by centOS7.2 and yum is a tough task. Nginx is compiled and installed in the usrlocalnginx directory. Current problems: 1. the service is started normally through servicenginxstart and servicephp-fpmstart, and everything is disabled normally, but no... the lnmp environment installed by centOS7.2 and yum is a tough task.
Nginx is compiled and installed in the/usr/local/nginx directory.
Current problems:
1. service nginx start and service php-
[Go to] find out the relationship between FastCgi and PHP-fpm, fastcgiphp-fpm. [Switch] find out the relationship between FastCgi and PHP-fpm. fastcgiphp-fpm: some people on the Internet say that fastcgi is a protocol, and php-fpm implements this protocol; some say, the php-
This article mainly introduces the PHP-FPM service startup script method, very good, with reference value, the need for friends can refer to the following
This is my own use, no problem, there are three paths need to modify their own discretion.
Create a self-boot file first:/etc/init.d/php-fpm
The contents are as follows:
#! /bin/sh### BEGIN INIT info# provides:php-f
What is PHP-FPM?The full name is the PHP fastcgi process Manager, the PHP fastcgi processes manager, which dynamically evokes the CGI process and destroys it to reach dynamic tuning CGI numbers compared to the fastcgi static arousal CGI,FPM, based on the pressure of the access. This allows for efficient use of memory. In addition, there are other advantages, such as FPM
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.