如何在CentOS 6上通过YUM安装Nginx和PHP-FPM
1个回答
2017-04-11
展开全部
开始安装Nginx和PHP-FPM之前,你必须卸载系统中以前安装的Apache和PHP。用root登录输入下面的命令:
# yum remove httpd* php*
增加额外资源库
默认情况下,CentOS的官方资源是没有php-fpm的, 但我们可以从Remi的RPM资源中获得,它依赖于EPEL资源。我们可以这样增加两个资源库:
# 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
输出样例
Retrieving http://download.fedora.redhat.com/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm
warning: /var/tmp/rpm-tmp.00kiDx: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing...########################################### [100%]
1:epel-release ########################################### [100%]
安装Nginx
输入下列命令
# yum install nginx
输出样例
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
nginx x86_64 0.8.54-1.el6 epel 358 k
Installing for dependencies:
GeoIP x86_64 1.4.8-1.el6 epel 620 k
fontconfig x86_64 2.8.0-3.el6 base 186 k
freetype x86_64 2.3.11-6.el6_1.8 updates 358 k
gd x86_64 2.0.35-10.el6 base 142 k
libX11 x86_64 1.3-2.el6 base 582 k
libX11-common noarch 1.3-2.el6 base 188 k
libXau x86_64 1.0.5-1.el6 base 22 k
libXpm x86_64 3.5.8-2.el6 base 59 k
libjpeg x86_64 6b-46.el6 base 134 k
libpng x86_64 2:1.2.46-1.el6_1 base 180 k
libxcb x86_64 1.5-1.el6 base 100 k
libxslt x86_64 1.1.26-2.el6 base 450 k
perl x86_64 4:5.10.1-119.el6_1.1 base 10 M
perl-Module-Pluggable x86_64 1:3.90-119.el6_1.1 base 37 k
perl-Pod-Escapes x86_64 1:1.04-119.el6_1.1 base 30 k
perl-Pod-Simple x86_64 1:3.13-119.el6_1.1 base 209 k
perl-libs x86_64 4:5.10.1-119.el6_1.1 base 575 k
perl-version x86_64 3:0.77-119.el6_1.1 base 49 k
Transaction Summary
================================================================================
Install 19 Package(s)
Upgrade 0 Package(s)
Total download size: 14 M
Installed size: 47 M
Is this ok [y/N]: y
如果你想在系统启动时自动运行nginx,输入下列命令
# chkconfig --level 345 nginx on
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询