How to install "php-fpm" in centos7: first install "php-fpm" related components through yum; then modify the content in "default.conf" to support php; finally restart the nginx service.
Recommended: "centos Getting Started Tutorial"
##CentOS7 uses yum to install Nginx php-fpm
Environment[root@localhost html]# cat /etc/centos-release CentOS Linux release 7.1.1503 (Core) [root@localhost sbin]# /usr/sbin/nginx -v nginx version: nginx/1.14.0 [root@localhost /]# php-fpm -v PHP 5.4.16 (fpm-fcgi) (built: Apr 12 2018 19:03:25) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm yum install -y nginx systemctl start nginx systemctl status nginx systemctl stop nginx systemctl enable nginx
http://192.168.0.61/
yum -y install php php-fpm php-gd php-mysql php-common php-pear php-mbstring php-mcrypt systemctl status php-fpm systemctl start php-fpm systemctl enable php-fpm
# location ~ \.php$ { root /usr/share/nginx/html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }
<?php phpinfo(); ?>
The above is the detailed content of How to install php-fpm on centos7. For more information, please follow other related articles on the PHP Chinese website!