1分钟完美安装最新 CentOS + Nginx + PHP-FPM + MySQL

PHP 5.3.1

MySQL 5.0.89

Nginx 0.8.33 或 0.7.65 (可选)

现在,我们可以快速全自动搞定 CentOS + Nginx + PHP-FPM + MySQL 的安装了

这个可比网上流传的什么一键安装包要好得多,强烈推荐此法安装,适合所有菜鸟和高手

我服务器上全用的源代码编译安装,也好不到哪去,还很费劲

我这个装完已经包含PHP的一些常用扩展, PDO,eaccelerator,memcache,tidy等等

先新建一个 repo

 
   
# vi /etc/yum.repos.d/centos.21andy.com.repo

放入如下内容

 
   
[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 repo

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

你可能感兴趣的:(mysql,nginx,centos,php-fpm)