Correctly set PHP-FPM child process user to improve website security prevent being hanged Trojan
Core Summary: The user that thephp-fpm child process uses cannot be the site file owner. Any violation of this principle does not conform to the
PHP-FPM Restart, abort Operation command in PHP 5.4:
View php Run Directory command: which PHP/usr/bin/php
To view the number of PHP-FPM processes:PS aux | Grep-c PHP-FPM
View running Memory/usr/bin/php-i|grep Mem
Restart PHP-FPM/ETC/INIT.D/PHP-FPM
Have a good long time of PHP, suddenly have an idea, want to put these together, so look at all kinds of information, find a very good explanation of the article, share a bit ~ ~First of all, what does CGI do? CGI is designed to ensure that the data
This article transferred from: http://segmentfault.com/q/1010000000256516First of all, what does CGI do? CGI is designed to ensure that the data passed by the Web server is in a standard format and facilitates the writer of CGI programs.Web server,
1.PHP-FPM two modes of instructionAnd PHP-FPM also exist in two ways, one is directly open the specified number of PHP-FPM process, no longer increase or decrease, the other is to start a certain number of php-fpm process, when the request is large,
first of all, what does CGI do? CGI is designed to ensure that the data passed by the Web server is in a standard format and facilitates the writer of CGI programs. Web server, such as Nginx, is simply the publisher of the content. For example, if
first of all, what does CGI do? CGI is designed to ensure that the data passed by the Web server is in a standard format and facilitates the writer of CGI programs. Web server, such as Nginx, is simply the publisher of the content. For example, if
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/
Reference from http://segmentfault.com/q/1010000000256516First of all, what does CGI do? CGI is designed to ensure that the data passed by the Web server is in a standard format and facilitates the writer of CGI programs.
Web server, such
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
To agree on several directories/usr/local/php/sbin/php-fpm/usr/local/php/etc/php-fpm.conf/usr/local/php/etc/php.ini one, php-fpm start parameters # Test PHP-FPM
Use Nginx official source, Epel extension library and remi source, remi source based on epel, must first install epel source, remi contains php-fpm, mysql-server5.5, if you only need php-fpm, you can install php-fpm separately and disable this
The configuration file name involved in this article is php-fpm.conf, which has the following important configuration items. Request_terminate_timeout30 # indicates that after 30 seconds, php scripts that are not automatically ended are ended to
In the Nginx configuration file, you can set how many nginx processes are enabled, as follows: worker_processes2; you can also set the maximum number of connections for each process, as shown below: worker_connections1024; php-fpm in the
: This article mainly introduces the Nginx + PHP-FPM optimization skills summary, for PHP tutorials interested in students can refer.
1. Socket communication in Unix domainBefore a brief introduction of Unix Domain Socket communication
This time to bring you php-fpm add service steps in detail, PHP-FPM Add service services attention to what, the following is the actual case, together to see.
Nginx running PHP through fastcgi than Apache contains PHP environment has obvious
Using Pcntl_fork to create a subprocess in PHP-FPM connection mode, the simplest piece of code is as follows:
Output 6 '-' in CLI mode, but only 2 '-' in PHP-FPM connection mode, that is, only the results of the main process or a child process
【】Php-fpmconfiguration optimization www.linuxidc.comlinux2011-0535346.htm ??? Request_terminate_timeout30 # indicates that after 30 seconds, php scripts that are not automatically ended are ended to release the occupied resources .?
[07-Dec-2015 17:07:08] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root[07-Dec-2015 17:07:08] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
Check php-fpm the log to find the above hint,
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.