CentOS6.5上安装nginx与php5.5

2014年04月08日

2014-04-08 12.54.20

1. 安装必要的包

# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

2. 添加仓库

添加/etc/yum.repos.d/nginx.repo文件,在nginx.repo中添加以下内容

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1

3. 安装 Nginx, PHP 5.5.9 and PHP-FPM

# yum --enablerepo=remi,remi-php55 install nginx php-fpm php-common

4. 安装 PHP 5.5.9 模块

# yum --enablerepo=remi,remi-php55 install php-pecl-apc php-cli php-pear php-pdo php-mysqlnd php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml

5. 停止httpd

# /etc/rc.d/init.d/httpd stop
# chkconfig httpd stop

启动nginx,php-fpm

请参考亚马逊AWS上安装Nginx(Linux,CentOS环境)