Home > Article > Backend Development > How to install php-fpm in php7
How to install and configure php-fpm in php7: 1. Install the PHP7 suite and plug-ins; 2. Create a socket descriptor file; 3. Modify the php-fpm configuration file; 4. Restart php-fpm.
The operating environment of this article: centos7 system, PHP version 7.1, Dell G3 computer.
How to install php-fpm in php7?
Install php7.1 and php-fpm (centos7, nginx)
#yum remove php-common
Details: https://wiki.centos.org/zh-tw/HowTos/php7?highlight=(php7)
First, install the software library (it is an official software library that needs to be started).
# yum -y install centos-release-scl.noarch
Install the PHP 7 suite and its plug-ins.
\ # yum -y install rh-php70 rh-php70-php rh-php70-php-fpm
- Set the values of user and group to nginx
user = nginx
group = nginx
- listen value setting is 127.0.0.1:9000, which is the same as the value of the fastcgi_pass parameter in the site configuration file
semanage port -a -t http_port_t -p tcp 9000
sudo touch /var/run/php7.1-fpm.sock sudo chown nginx:nginx /var/run/php7.1-fpm.sock sudo chmod 666 /var/run/php7.1-fpm.sock
- The values of user and group are set to nginx
user = nginx
group = nginx
- The value of listen is set to /var/run/php7. 1-fpm.sock, which is the same as the value of the fastcgi_pass parameter in the site configuration file
- Remove the semicolon in front of listen.owner, listen.group, and listen.mode to make php-fpm use unix socket and change The values of listen.owner and listen.group are set to nginx
listen.owner = nginx
listen.group = nginx
The above is the detailed content of How to install php-fpm in php7. For more information, please follow other related articles on the PHP Chinese website!