如何在CentOS 6上通过YUM安装Nginx和PHP-FPM

2025-04-27 00:24:36
推荐回答(2个)
回答1:

1,安装EPEL源:
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

2,安装EPEL源
(64位系统) rpm -ivh http://download.fedora.redhat.com/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm
(32位系统) rpm -ivh http://download.fedora.redhat.com/pub/epel/6/i386/epel-release-6-5.noarch.rp

3,安装nginx php-fpm
yum install nginx php-fpm

4,设置nginx、php-fpm开机启动:
chkconfig nginx on
chkconfig php-fpm on

5,启动nginx php-fom
service nginx start
servicephp-fom start

回答2:

必须卸载系统中以前安装的Apache
# yum remove httpd* php*
# yum install yum-priorities -y
# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

安装Nginx
# yum install nginx
安装PHP-FPM
# yum --enablerepo=remi install php php-fpm