" ' ' $http _user_agent ' $http _x_forwarded_for '; access_log /usr/local/var/log/nginx/access.log Main; Port_in_redirect off; sendfile on; keepalive_timeout 65; include/usr/local/etc/nginx/conf.d/*.conf; } default.conf file contents,
server {Listen 8080;server_name localhost;root/users/user_name/nginx_sites/; # This item is to be modified for you to store the path to the relevant pageLocation/{Index index.php;AutoIndex on;}#proxy the PHP scripts to PHP-FPMLocation ~ \.php$ {include
./config--prefix=/usr/local/openssl-1.0.1MakeMake installInstalling the nginx-- Server SoftwareTAR-ZXVF nginx-1.2.8.tar.gzCD nginx-1.2.8./configure--prefix=/usr/local/nginx-1.2.8 \--with-pcre=. /pcre-8.21/\--with-zlib=. /zlib-1.2.8/MakeMake installSetting Nginx-Initiated configuration files/usr/local/nginx-1.2.8/sbin#./nginx-c/usr/local/nginx-1.2.8/conf/nginx.conf/usr/local/nginx-1.2.8/sbin#./nginx-s ReloadView Nginx ProcessPs–ef|grep NginxOpen localhostWhen you see the content shown, the Nginx
What are CGI, FastCGI, PHP-CGI, PHP-FPM, and 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 can be written in any language as long as it has standard input, output, and environment variables. Such as php, perl, and tcl.
What is FastCGI?
FastCGI is like a long-live CGI. it can be executed all the time, it
Problem description: The boss told me a problem they encountered two days ago. php started with fastcgi and opened the slowlog. When fsockopen was called to read a connection, when the connection exceeds the slowlog setting time, the fpm process throws a warning to record some basic information about the full request. Detailed description
Problem description: The boss told me a problem they encountered two days ago. php started with fastcgi and opened
https://segmentfault.com/q/1010000000256516I check the relationship between FastCGI and php-fpm on the Internet, check for a week, the basic look at the times, it is very divergent opinions, there is no authoritative definition.Online some say, fastcgi is a protocol, PHP-FPM realize this agreement, some say, PHP-FPM is fastcgi process Manager, used to manage the
Webbench can simulate up to 30,000 concurrent connections to test the load capacity of the website, the personal feeling is better than the AB pressure test tool with Apache, installation and use is particularly convenient. 1. Applicable system: Linux2. Compile and install: Referenceswget http://blog.s135.com/soft/linux/webbench/webbench-1.5.tar.gzTar zxvf webbench-1.5.tar.gzCD webbench-1.5Make make install3. Use: ReferencesWebbench-c 10000-t http://127.0.0.1/test.jpgparameter Description:-C
PS aux |grep php-fpm |moreView Total PHP-FPM
php-fpm.conf Configuration
PID string
The location of the PID file. The default is empty.
Error_log string
The location of the error log. Default: Installation path #install_prefix#/log/php-fpm.log.
Log_level string
The error level. Available levels are: alert (must be processed immediately), error (Errors), warning (warning condition), notice (general important
What are CGI, FastCGI, PHP-CGI, PHP-FPM, and Spawn-FCGI? In the php runtime environment configuration, which one is more suitable for websites.
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 can be written in any language as long as it has standard input, output, and environment variables. Such as php, perl, and tcl.
Wh
CGI, FastCGI, PHP-CGI, PHP-FPM, and Spawn-FCGI modes
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 can be written in any language as long as it has standard input, output, and environment variables. Such as php, perl, and tcl.
What is FastCGI?
FastCGI is like a long-live CGI. it can be executed all the time, it will not take ti
) can work. fastcgi of the poor Because 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 in 30,000 concurrent connection, open 10 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
PHP-FPM is a phpfastcgi process manager and is for PHP only.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 the PHP-FPM bran
This article is about the PHP surface question five how nginx call PHP and PHP-FPM function and work principle, have a certain reference value, now share to everyone, have the need of friends can refer to
Nginx How to invoke PHP
The use of nginx+php as an architectural model of webserver is widely used today. The first step, however, is to get Nginx to invoke PHP correctly. Because Nginx calls PHP is not as straightforward as calling a static file, i
"Turn" to understand the relationship between fastcgi and PHP-FPM, FASTCGIPHP-FPM
Question: Online 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
What are CGI, FastCGI, PHP-CGI, PHP-FPM, and Spawn-FCGI ?, Fastcgiphp-cgi
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 can be written in any language as long as it has standard input, output, and environment variables. Such as php, perl, and tcl.
What is FastCGI?
FastCGI is like a long-live CGI. It can be executed
listening port, epoll_wait waits for a connection.Then distributed to the worker process in the pool, the worker process Accpet the Request poll processing the connection.Should be:The master process does not receive and distribute the request, but the worker process poll processing directly after the Accpet request.after viewing the source code structure, PHP has supported the Epoll model, epoll,accept after listening pollThe master process constantly calls Epoll_wait and getsockopt to handle
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
1 "Download PHP source code#wget Http://cn2.php.net/get/php-5.4.30.tar.gz/from/this/mirrorThe version of official website 5.2 does not seem to offerTo PHP-5.2.13-FPM php-5.2.13.tar.gz compatible to my Baidu share address download Http://pan.baidu.com/s/1sjwLdNZ2 "Download php-5.2.13-fpm-0.5.13.diff.gzwget http://php-fpm.org/downloads/php-5.2.13-fpm-0.5.13.diff.gz
I. Installation of Nginx
Be careful not to forget to install Pcre
Two. Install PHP
1, download the PHP source code package
http://www.php.net/downloads.php
2. Install PHP
TAR-XVF php-5.5.13.tar.bz2
CD php-5.5.13
./configure--prefix=/usr/local/php--with-config-file-path=/etc--enable-inline-optimization--disable-debug- Disable-rpath--enable-shared--enable-opcache--enable-fpm--with-fpm-user=www--with-
LNMP use socket to connect Nginx optimize PHP-FPM performance
There are 2 ways to connect fastcgi nginx: TCP and UNIX domain sockets
What is a UNIX domain socket. --Wikipedia
A Unix domain socket or an IPC socket is a terminal that enables data communication between two or more processes on the same operating system. Compared to pipelines, Unix domain sockets can use both byte streams and data queues, while pipe traffic can only be accessed by
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.