Board logo

標題: [介紹] 安裝 Nginx 1.6 + PHP 5.5 on CentOS 6.5 [打印本頁]

作者: altis    時間: 2014-6-26 15:39     標題: 安裝 Nginx 1.6 + PHP 5.5 on CentOS 6.5

目前主流的 nginx 已經更新到 1.6 版了... PHP也到 5.5 ...如果這時你要更新到最新版本...
可以這樣做...環境是 CentOS 6.5 64bit

1. Install EPEL and Remi CentOS 6 Repository:
# rpm -ivh https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

2. Next step to install Nginx is to create Nginx Repository file
建立 /etc/yum.repos.d/nginx.repo 這個檔.內容如下:
引用:

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


3. Install Nginx, PHP 5.5 and PHP-FPM packages
# yum --enablerepo=remi,remi-php55 install nginx php-common php-fpm php-mysqlnd php-mbstring php-mcrypt php-gd

4. Nginx is installed, start Nginx Web Server and PHP-FPM
# service nginx start
# service php-fpm start

5. Enable Nginx and PHP-FPM autostart on boot
# chkconfig nginx on
# chkconfig php-fpm on

6. 檢查版本對不對
# php -v
引用:

PHP 5.5.13 (cli) (built: Jun  5 2014 16:44:19)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies


# nginx -v
引用:

nginx version: nginx/1.6.0


搞定…收工囉~~






歡迎光臨 ADJ網路實驗室 (http://dz.adj.idv.tw/) Powered by Discuz! 6.0.0