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
This article introduces how to install and configure nginx, mysql, and php-fpm instances through homebrew.
1.1. Environment selection:Re-configure php on mac. Originally, the mac was equipped with apach, php, and pgsql. If the figure is simple, you can use it directly, however, before installation, I carefully thought about several issues:
Apache or nginx: I know a little about both of them. I have a lot of access to nginx, and my servers use nginx. N
Nginx process consumes 150M memory (15m*10=150m), open 64 php-cgi process consumes 1280M of memory (20m*64= 1280M), combined with the memory consumed by the system itself, consumes less than 2GB of memory. If the server memory is small, you can only open 25 php-cgi processes, so that the total amount of memory consumed by php-cgi is 500M. What is php-cgiPHP-CGI is the fastcgi manager that comes with PHP.To start php-cgi, use the following command:127.0. 0.1:9000 Php-cgi of the poor1, php-cgi
(20m64=128 0M), combined with the memory consumed by the system itself, consumes less than 2GB of memory.If the server memory is small, you can only open 25 php-cgi processes, so that the total amount of memory consumed by php-cgi is 500M.7. What is php-cgiPHP-CGI is PHP's own fastcgi managerTo start php-cgi, use the following command:/usr/bin/php-cgi-b 127.0.0.1:90008.php-cgi of the poor1, php-cgi change php.ini configuration need to restart php-cgi to let the new Php-ini take effect, can not
This article starts in the Slime row world. A few days ago study, under the Nginx build WordPress blog. In the article "Slime: Using Nginx to build WordPress blog", we specifically mentioned the user under which the program runs. 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 c
, 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
Request_terminate_timeout30 # indicates that after 30 seconds, php scripts that are not automatically ended are ended to release the occupied resources. Pm indicates the method used, that is, static (static) or dynamic (dynamic ). In older versions, dynamic is called apache-like. Pm. max_children: ph enabled in static mode
Request_terminate_timeout = 30 # indicates that after 30 seconds, php scripts that are not automatically ended are ended to release the occupied resources. Pm indicates the me
In the PHP-FPM to set up chroot, has a good isolation function, improve the system security, but to establish a reasonable PHP-FPMChroot environment is a little difficult, than the use of debootstrap and other tools to build more trouble, this article introduces the Chroot execution environment of PHP-FPM in detail, the need of friends can refer to the next. In the PHP-
After migrating the architecture from Apache + mod_php to nginx + FPM, you will find that if a PHP script error occurs, no record is recorded in eror_log of nginx, and only 500 status code is recorded in access_log. Cause: nginx transfers the PHP script to FPM through FastCGI, so the error information will not be recorded in the error_log of nginx, however, debugging by programmers in the testing environmen
Create a PHP-FPM Service Group
650) This. width = 650; "Title =" php-fpm .png "src =" http://s3.51cto.com/wyfs02/M00/45/D0/wKioL1PrmMLy5QDQAAHT-dRHcoI557.jpg "alt =" wKioL1PrmMLy5QDQAAHT-dRHcoI557.jpg "/>
Is the working principle of PHP-FPM
1. Compile and install the php-5.4.26
Download the source code file of PHP by yourself. Here we will install php2.4 as an e
In the PHP-FPM to set up chroot, has a good isolation function, improve the system security, but to establish a reasonable PHP-FPMChroot environment is a little difficult, than the use of debootstrap and other tools to build more trouble, this article introduces the Chroot execution environment of PHP-FPM in detail, set up chroot in PHP-FPM, has a good isolation
Original address: https://segmentfault.com/q/1010000000256516Online some say, fastcgi is a protocol, PHP-FPM realize this agreement, some say, PHP-FPM is fastcgi process Manager, used to manage the fastcgi process; some say, PHP-FPM is a patch of PHP kernel; Some said that, after modifying the php.ini configuration file, there is no way to smooth restart, so the
1 overviewthe PHP-FPM (FastCGI process manager:fastcgi Progress Manager) is a PHP FastCGI Manager, for PHP 5.3.3 before PHP, is a patch package designed to integrate FASTCGI process management into the PHP package. If you're using PHP before PHP5.3.3, you'll have to patch it into your PHP source code, which you can use after compiling and installing PHP. makePHPrun onFPMmode to run, makingPHPform a separate module, not justhttpdunder a module,PHPy
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 parameter#测试php-fpm配置/usr/local/php/sbin/php-fpm-t/usr/local/php/sbin/php-fpm-c /usr/local/php/etc/php.ini -y /usr/local/php/etc/php-fpm.con
To agree on several directories
/USR/LOCAL/PHP/SBIN/PHP-FPM
/usr/local/php/etc/php-fpm.conf
/usr/local/php/etc/php.ini
First, the PHP-FPM start parameter
#测试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
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.