CentOS重装YUM,YUM安装PHP升级到PHP5.2,瞎折腾之笔记

支持的镜像有
http://ftp.sjtu.edu.cn
http://mirrors.163.com
http://mirrors.sohu.com

wget /centos/5/os/x86_64/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm
chmod 755 python-iniparse-0.2.3-4.el5.noarch.rpm
rpm -ivh python-iniparse-0.2.3-4.el5.noarch.rpm

# setup yum-metadata-parser
wget http://ftp.sjtu.edu.cn/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpm
chmod 755 yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpm
rpm -e –nodeps yum-metadata-parser-1.0-8.fc6
rpm -ivh yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpm

# setup yum
wget http://ftp.sjtu.edu.cn/centos/5/os/x86_64/CentOS/yum-3.2.22-33.el5.centos.noarch.rpm
chmod 755 yum-3.2.22-33.el5.centos.noarch.rpm
rpm -ivh –nodeps yum-3.2.22-33.el5.centos.noarch.rpm

一键安装LAMP环境

yum -y install httpd php mysql mysql-server php-mysql httpd-manual mod_ssl mod_perl mod_auth_mysql php-mcrypt php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc mysql-connector-odbc mysql-devel libdbi-dbd-mysql

centos 5.x目前提供php版本为5.1.6,现可以升级到PHP5.2.6以上版本

rpm –import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
vi /etc/yum.repos.d/CentOS-Base.repo 增加下面信息

[utterramblings]
name=Jason’s Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka

#执行命令,自动升级。
yum update php -y
yum install libmcrypt -y

yum -y install httpd php mysql mysql-server php-mysql httpd-manual mod_ssl mod_perl mod_auth_mysql php-mcrypt php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc mysql-connector-odbc mysql-devel libdbi-dbd-mysql