当前位置: > Linux服务器 > nginx >

centos非编译安装nginx+fastcgi+php+mysql环境详细教程

时间:2014-11-08 12:25来源:linux.it.net.cn 作者:IT

centos非编译安装nginx+fastcgi+php+mysql

centos安装nginx,可以从源码安装,需要自己编译,参照官方文档:http://wiki.nginx.org/nginxchsinstall

这里介绍下使用非编译安装方式安装nginx+php+fastcgi+mysql环境的方法,一起来了解下。

首先,安装nginx源:
 

rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm

然后,安装fastcgi模式的php环境,需要安装php-fpm,这里用到二个源 EPEL源和REMI源。
1、remi包含php-fpm,mysql-server5.5
2、remi源基于epel,必须先安装epel源

1)、安装epel源
 

(64位系统) rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm
(32位系统) rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm

2、安装REMI源
 

rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

开启remi,通过编辑 /etc/yum.repos.d/remi.repo
vi /etc/yum.repos.d/remi.repo

修改 enable=1
 

esc
:wq

然后,yum安装:
 

yum -y install nginx mysql-server  php-fpm php-cli php-pdo php-mysql php-mcrypt php-mbstring php-gd php-tidy php-xml php-xmlrpc php-pear php-pecl-memcache php-eaccelerator

没有异常的,nginx+fastcgi+php+mysql安装成功。



 
(责任编辑:IT)
------分隔线----------------------------
栏目列表
推荐内容