PHP 5.3.1php
MySQL 5.0.89mysql
Nginx 0.8.33 或 0.7.65 (可選)nginx
如今,咱們能夠快速全自動搞定 CentOS + Nginx + PHP-FPM + MySQL 的安裝了sql
這個可比網上流傳的什麼一鍵安裝包要好得多,強烈推薦此法安裝,適合全部菜鳥和高手centos
我服務器上全用的源代碼編譯安裝,也好不到哪去,還很費勁服務器
我這個裝完已經包含PHP的一些經常使用擴展, PDO,eaccelerator,memcache,tidy等等php-fpm
先新建一個 repourl
#
vi /etc/yum.repos.d/centos.21andy.com.repo
放入以下內容spa
[21Andy
.
com] name
=
21Andy
.
com Packages
for
Enterprise Linux
5
-
$basearch
baseurl
=
http
:
//
www.21andy.com/centos/5/$basearch/
enabled
=
1
gpgcheck
=
0
protect
=
1
啓用 EPEL repocode
i386
rpm -ihv
http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
x86_64
rpm -ihv
http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
接着導入key
rpm
--
import
/
etc
/
pki
/
rpm
-
gpg
/
RPM
-
GPG
-
KEY
-
EPEL
好了,一鍵安裝
#
yum install nginx php-fpm mysql-server
若是 nginx 你要用 0.7.65 最新穩定版,把yum -y install nginx換成yum -y install nginx-stable就能夠了
更完整的安裝
yum
-
y update yum
-
y
mysql
-
server service mysqld start mysqladmin
-
u root password root service mysqld stop yum
-
y install nginx 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
#
APC 和 eAccelerator 有衝突,2選1
yum
-
y install php
-
pecl
-
apc
看下個人完整安裝,只要一句
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
安裝結果,全自動
Dependencies Resolved
==========================================================
Package Arch Version Repository Size
==========================================================
Installing
:
mysql
x86_64
5.0
.
89
-
1
.
el5 21Andy
.
com
3.5
M
mysql
-
server x86_64
5.0
.
89
-
1
.
el5 21Andy
.
com
10
M nginx x86_64
0.8
.
33
-
3
.
el5 21Andy
.
com
422
k php
-
cli x86_64
5.3
.
1
-
2
.
el5 21Andy
.
com
2.4
M php
-
eaccelerator x86_64
2
:
0.9
.
6