The pool of PHP-FPM
NIGNX can configure multiple virtual hosts, PHP-FPM also support the configuration of multiple pool, each pool can listen to a port, can also listen to a socket.
PHP-FPM Configuration Instructions:
Unlike lamp, in the LNMP architecture, PHP-FPM as a standalone service exists,
ReferenceHttp://syre.blogbus.com/logs/20092011.htmlhttp://www.mike.org.cn/articles/what-is-cgi-fastcgi-php-fpm-spawn-fcgi/Http://www.larro.cn/?p=35Nginx PHP php-fpm CGI fastcgi and so on the relationship between them confusing, Google found a day a lot of good articles introduced, but are all said to let people crazy, hereby will be the above several predecessors of the article re-organized a bit, in the sp
12.21 PHP-FPM's PoolPHP-FPM supports the definition of multiple pool, each of which can listen to different sockets or different TCP/IP;If Nginx has a number of different sites, then each site can use a pool;If all the sites are using the same pool, when it is not enough for a PHP resource, or other reasons cause 502, the site is a problem, then all sites are not normal use;Therefore, it is necessary for us to isolate different sites and use different
, 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:
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
----------------------- turn on php-fpm slow script logRequest_slowlog_timeout = 30sSlowlog =/usr/local/php/var/log/php-fpm.log.slowTypical log content is as follows:[15-apr-2012 20:56:19] [Pool www] pid 9748Script_filename =/var/www/html/htdocs/www.xxx.com/xxx.php[0x00000000090bc270] file_get_contents ()/var/www/html/htdocs/www.xxx.com/xxx.php:81Slow script files, specific lines, functions and so on are all very detailed records, the optimization of
Php-fpm startup ?????? Php5.3.3 the source code starts to contain php-fpm. you don't need to fix it any more. you just need to unlock the source code and directly configure it, for php-fpm compilation parameters,-enable-fpm-with-fpm-user = www-with-
On several offline servers that are not very busy, the number of PHP-FPM processes is found to be more than 500, and some processes run for several months.
The following troubleshooting was performed to determine if there is a problem with the PHPFPM operation and whether a reboot is required.
To see if these processes are started properly
Because the start and recycle times of the worker process are printed at the notice level in Php-fpm.log, you
Build LNMP today when installed PHP-FPM appeared a problem for one hours finally solved the problem, make the next record convenient for everyone to check although very small pediatric. Environment: The Redhat 7.2 version of the Yum source is also 7.2 iso [[emailprotected] lnmp_soft]# yum-y install php-fpm-5.4.16-42.el7.x86_64. RPM Loaded plugins: LangPacks, Product-id, Search-disabled-repos, Subscription
PHP-FPM installation is simple, see PHP (PHP-FPM) manual compilation installation. The following is mainly about how to improve the performance of NGINX+PHP-FPM.
1.Unix domain Socket communication
A brief introduction to UNIX domain socket this way of communication, see: NGINX+PHP-FPM Socket Configuration method
UNI
.rpmmhash-0.9.9-1.el5.centos.i386.rpmmhash-devel-0.9.9-1.el5.centos.i386.rpmmcrypt-2.6.8-1.el5.i386.rpm
It is best to install the RPM package above using the upgrade method, which is as follows:# RPM-UVHIn addition, can also be installed according to the needs of libevent, the system will generally bring libevent, but the version is somewhat low. So you can upgrade the installation, which contains the following two RPM packages.libevent-2.0.17-2.i386.rpmlibevent-devel-2.0.17-2.i386.rpmDescriptio
This article focuses on the experiment where PHP connects httpd to work in an fpm manner. In the case of PHP's FPM mode, the simple point is that PHP can serve as a standalone server instead of working as a HTTPD program module in the same way as in the previous article. This time I will install each service separately on a single server to work.First, topology diagram: Picture obscured, MySQL (10.0.0.105)6
A way to configure PHP-FPM as a service in Linux
2012-07-20 by Jason
1. Configure php-fpm.conf
Vi/usr/local/php/etc/php-fpm.conf
Php-fpm.pid directory must point to:/usr/local/php/var/run/php-fpm.pid 2. Copy php-fpm script to/etc/init.d directory
cp/home/soft/php-5.3.15/sapi/fpm/init.d.php-fpm/etc/init.d/php-
same connection to the Web server. When the fastcgi child process closes the connection, the request is processed. The fastcgi process then waits and processes the next connection from the FASTCGI process Manager, which is running on the Web server. In the CGI model, php-cgi quits.
In the above scenario, you can imagine how slow CGI is usually, and every Web request PHP must reparse php.ini, reload all extensions, and reinitialize all of the data structures. With fastcgi, all of these occur onl
Currently, the latest 5.3.x php-fpm has two ways to manage processes: static and dynamic. if it is set to static, the number of processes is always pm from start to end. the number specified by max_children. start... currently, the latest 5.3.x php-fpm has two ways to manage processes: static and dynamic. if it is set to static, the number of processes is always pm from start to end. the number specified by
PHP-FPM detailed
Original link: http://php-fpm.anight.org/wiki:http://www.php-fpm.com/Translation: http://syre.blogbus.com/logs/20092011.html
What is FastCGI
FastCGI is a scalable, high-speed interface for communication between Web servers and scripting languages. More information on fastcgi technology can be found on the official website and Wikipedia.
FastCGI is supported by many scripting languages, including PHP, if compiled with the--enabl
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.