times better than Apache (version 6th)
What is PHP-CGI
PHP-CGI is the FastCGI manager that comes with PHP. Start the PHP-CGI with the following command:
php-cgi -b 127.0.0.1:9000
PHP-CGI Deficiency
After changing the php. ini configuration of PHP-CGI, restart PHP-CGI to make the new PHP-ini take effect.
Directly kill the PHP-CGI process, and PHP cannot run. (PHP-FPM and spawn-fcgi don't have this problem, and the daemon will smoothly generate new
smooth restart
2, directly kill the php-cgi process, PHP can not run. (PHP-FPM and spawn-fcgi do not have this problem, the daemon will smoothly regenerate new child processes.) )
What is PHP-FPM
PHP-FPM is a PHP fastcgi manager that is only used in PHP and can be downloaded in http://php-fpm.org/download.
PHP-FPM
, directly kill the php-cgi process, PHP can not run. (PHP-FPM and spawn-fcgi do not have this problem, the daemon will smooth the new child process from the newly generated.) ) What is PHP-FPMPHP-FPM is a PHP fastcgi manager that is only for PHP and can be downloaded in http://php-fpm.org/download.PHP-FPM is actually a patch of PHP source code designed to integ
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
Background
Recently moved WordPress to Aliyun. Because its own server is a cloud server, hard disk and memory are relatively small, so the memory is often not enough, through the Linux command view, found that the number of boot PHP-FPM process has more than 20, occupy nearly 1G of memory, The entire server is only 1.5G of memory, and finally through the PHP-FPM process number optimization To solve this pr
Service is NGINX+PHP-FPM configuration,After running for a period of time, it will often appear:WARNING: [Pool www] server reached Pm.max_children setting (a), consider raising it sub-process reaches the maximum number of child processes required 503/502 generally because of server maintenance or overload, the recent server is not maintenance, query monitoring records found that the load is not very high, guess is not the server on some configuration
Tags: system end system base command line x86 SQL string Targe WordWe want to use Yum to install PHP-FPM and compare the new version of Php,nginx,mysql-server, first we have to add a few sources for Yum, the CentOS default source inside the software is older, some software, libraries have not. Epel Source: Extra Packages for Enterprise Linux (or EPEL) or a corporate Linux add-on is a special interest group created, maintained, and managed for Red Hat
On the basis of the official centos started a container, installed in the PHP-FPM. now I want this container to run in the background, and another container (such as the NGINX server container) is connected to its PHP-FPM service. The following is my startup parameter: {code ...} {code ...} the container does not seem to be... on the basis of the official centos started a container, installed in the PHP-
Contract several directories
/usr/local/php/sbin/php-fpm/usr/local/php/etc/php-fpm.conf/usr/local/php/etc/php.iniOne, the php-fpm start parameterCopy CodeThe code is as follows:#测试php-FPM Configuration/usr/local/php/sbin/php-fpm-t/usr/local/php/sbin/php-fpm-c/usr/local/php/
1 PHP-FPM Process PoolBefore we added an include vhost/*.conf in the Nginx configuration file; Then realize the isolation of each virtual host, php-fpm as a separate service, there is no similar operation? The answer is yes. Here we introduce a PHP-FPM process pool concept. Pool in the LNMP schema is a collection of process resources allocated to parse PHP. PHP-
Php-FPM configuration in nginx tutorialNginx can directly call FPM to drive php and then discard apache. Let's not talk about the reason.First download the php5.4 installation package.According to others The code is as follows:Copy code . /Configure -- enable-fastcgi -- prefix =/data1/server/php-cgi -- with-gd -- with-jpeg-dir -- with-png-dir -- with-freetype-dir -- enable-mbstring -- with-mysql --
This article describes how to configure nginx + php-fpm mode in buntu10.04. For more information, see
Install php-fpm using ppaInstallation Kit
The code is as follows:
$ Sudo apt-get install python-software-properties
Add ppa source
The code is as follows:
$ Sudo add-apt-repository ppa: yola/php5
Install php5-fpm
The code is as follows:
Sudo apt-get updateS
What is PHP-FPM
PHP-FPM is a PHP fastcgi manager that is used only for PHP,
PHP-FPM is actually a patch of PHP source code designed to integrate FASTCGI process management into a PHP package. It must be patch into your PHP source code and can be used after compiling and installing PHP.
Now we can download in the latest PHP 5.3.2 source tree to directly integrate
To agree on several directories
yusr/local/php/sbin/php-fpm/usr/local/php/etc/php-fpm.conf/usr/local/php/etc/php.ini
Startup parameters for PHP-FPM
#测试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
In this article, we will specifically explain the configuration of Nginx, PHP-FPM, and MySQL running under individual users.
First of all to do a description:Nginx itself can not handle PHP, it is just a Web server. When a client request is received, if it is a PHP request, it is forwarded to the PHP interpreter for processing and returns the result to the client. If it is a static page, Nginx handles it itself and returns the result to the c
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.