-reload)
Force_reload
;;
Status)
Rh_status
;;
Condrestart | try-restart)
Rh_status_q | exit 0
;;
*)
Echo $ "Usage: $0 {start | stop | status | restart | condrestart | try-restart | reload | force-reload | configtest }"
Exit 2
Esac
Save the edited file and run the following command:
Sudo chmod + x/etc/init. d/nginx
Sudo/sbin/chkconfig nginx on
# Check
Sudo/sbin/chkconfig -- list nginx
Nginx 0: off 1: off 2: on 3: on 4: on 5: on 6: off
Done! Run the following command to manage Nginx:
Service n
Correctly set the php-fpm sub-process user to improve website security and prevent Trojans. Summary: The user used by the php-fpm sub-process cannot be the website file owner. Any violation of this principle does not comply with the minimum permission principle .? According to continuous feedback in the production environment, php websites are found to be infected with Trojans, most of which are caused by i
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, consumes less than 2GB of memory. If the server memory is small, you can onl
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, consumes less than 2GB of memory. If the server memory is small, you can onl
Two configuration file differences:Manage profiles used by the PHP-FPM service:/usr/local/php/etc/php-fpm.confPHP Global configuration:/usr/local/php/etc/php.iniTo empty the/usr/local/php/etc/php-fpm.conf configuration file:[Email protected] vhosts]# >/usr/local/php/etc/php-fpm.confWhen you open it, it's empty:[Email protected] vhosts]# vim/usr/local/php/etc/php-fpm.confEnter the following content:(original) [Global]PID =/usr/local/php/var/run/php-fpm
Configuration php-5.4.13 in FPM (FastCGI) and Apache interactionFirst, the installation of Apache and MySQL is the same as the previous part; Please install it according to it;Second, compile and install php-5.4.131, to resolve the dependency relationship:# yum-y Groupinstall "X Software Development"If you want the compiled PHP to support the MCrypt extension, the following two RPM packages need to be installed:libmcrypt-2.5.7-5.el5.i386.rpmlibmcrypt-
PHP-FPM in the establishment of chroot, has a very good isolation, improve the security of the system, but to establish a reasonable PHP-FPM chroot environment is a bit more difficult, than the use of debootstrap and other tools to build more trouble, the following by reference to the relevant information, The php-fpm of the chroot implementation of the environme
Nginx itself cannot process PHP. it is only a web server. after receiving the request, if it is a php request, it is sent to the php interpreter for processing and the result is returned to the client. Nginx generally sends requests to the fastcgi management process. The fascgi management process selects the cgi sub-process to process the results and returns the results... nginx itself cannot process PHP. it is only a web server. after receiving the request, if it is a php request, it is sent to
: This article mainly introduces the PHPFastCGI process manager PHP-FPM architecture, for PHP tutorials interested in students can refer.
A master process supports multiple pools. each pool listens to different ports from the master process. The pool has multiple worker processes.Each worker process has a built-in PHP interpreter, and the process is resident in the background, supporting dynamic addition of prefork.Each worker process supports compil
, 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, consumes less than 2GB of memory. If the server memory is small, you can only open 25 php-cgi processes, so that the t
This article is starting in Slime Line the 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. W
This article describes how to configure and pay attention to performance optimization through php-fpm. if you need it, refer to the following introduction:
PHP-FPM is a PHP FastCGI manager, the general Nginx above the run PHP program will be PHP program thrown to the PHP-FPM for parsing. Okay, that's it!
PHP 5.4 began to integrate the PHP-
./Configure -- pid-path =/usr/local/nginx/logs/nginx. pid -- sbi
In this tutorial I will try to install php-fpm with nginx on centos 5.3. But first:What is PHP-FPM?
PHP-FPM is a patch for PHP4/5 to greatly improve PHP's FastCGI SAPI capabilities and administration. this means that you don't install php through your distribution's package manager, but rather downl
Specify Directories
/Usr/local/php/sbin/php-fpm/Usr/local/php/etc/php-fpm.conf/Usr/local/php/etc/php. iniI. startup parameters of php-fpmCopy codeThe Code is as follows:# Test the configuration of 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.co
For php-fpm and cgi, and the understanding of concurrent responses, php-fpmcgi
Reference link:
Https://www.zhihu.com/question/64414628What is the relationship between the number of php fpm processes and the number of concurrent processes?
-Https://segmentfault.com/q/1010000005942449/a-1020000012063637 php does not support multithreading so don't consider concurrency issues?
-Http://bbs.csdn.net/topics/39077
Nginx and PHP-FPM Startup/restart Scripts
Both Nginx and PHP on the server are compiled and installed by source code, and do not support the same nginx (Start|restart|stop|reload) as before. Get your hands on your own. The following script should be used in Rhel, Fedora,centos.
First, Nginx startup script/etc/init.d/nginx
#!/bin/bash## Startup script for Nginx-this script starts and stops the Nginxdaemon## Chkconfig: -8515# Description:Nginx is an HT
. El6 Epel
Discover the latest stable version of 1.6.3, and then execute directly
Yum Install Nginx-y
When the installation is complete, the Nginx can be started directly below:
/etc/init.d/nginx start
starting nginx: [ OK ]
Now that the Nginx has started, the direct access server will be able to see the Nginx Welcome page.Nginx command and configuration file location:
/etc/init.d/nginx Start # starts Ngin
php5.3 comes with PHP-FPM/usr/local/php/etc/php-fpm.confPID = Run/php-fpm.pidPID settings, default in the installation directory of/var/run/php-fpm.pid, it is recommended to openError_log = Log/php-fpm.logError log, default in the installation directory of/var/log/php-fpm.logLog_level = NoticeThe error level. The available levels are: alert (which must be processed immediately), error (Error condition), warning (warning condition), notice (general imp
Nginx and Apache are not the same, in Apache can directly specify the error log php, so that in the PHP implementation of the error message directly into the PHP error log, you can easily query.
In Nginx, things have become like this: Nginx only access to the page to make access log. There will be no error log information for PHP. Nginx to the PHP request to the PHP-FPM fastcgi process to deal with, the default php-
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.