Centos安装PHP5.3

之前转了一篇文章[转]How to install PHP 5.3 on CentOS,发现这种方法只适用于我,今天帮别人安装的时候,不可用。

我找了下面这个方法,也能成功安装php5.3.20

其中,他之前安装了nignx,虽然删除了但是还占用80。我们把它找出来kill掉。

ps -aux | grep nginx
kill -9 pid

问题1:error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)' 

mysql-server没有安装:#yum install mysql-server

 

问题2:ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'root'

mysql -uroot -p

----------------------------------------------

今天从  atomicorp.com  安装 php5.3

1、安装  repository key

To enable access to both the atomic yum repository use the following automated installer:

>wget -q -O - http://www.atomicorp.com/installers/atomic | sh

 

2、创建新的 yum 源

>vim /etc/yum.repos.d/CentOS-Atomicorp.repo

内容如下:

[atomic]
name = CentOS / Red Hat Enterprise Linux $releasever - atomicrocketturtle.com
mirrorlist = http://www.atomicorp.com/mirrorlist/atomic/centos-5-$basearch
#mirrorlist = http://www.atomicorp.com/channels/atomic/centos/5/mirrors-atomic
enabled = 1
priority = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY.art.txt
gpgcheck = 1

#Almost Stable, release candidates for [atomic]
[atomic-testing]
name = CentOS / Red Hat Enterprise Linux $releasever - atomicrocketturtle.com - (Testing)
mirrorlist = http://www.atomicorp.com/mirrorlist/atomic-testing/centos-5-$basearch
enabled = 0
priority = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY.art.txt
gpgcheck = 1

#Untested, Unstable, known buggy, and incomplete packages.
#[atomic-bleeding]
#name = CentOS / Red Hat Enterprise Linux $releasever - atomicrocketturtle.com - (Bleeding)
#baseurl = http://www.atomicorp.com/channels/atomic-bleeding/centos/5/$basearch/
#enabled = 0
#priority = 1
#protect = 0
#gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY.art.txt
#gpgcheck = 1

 

3、安装 php

>yum install php

posted @ 2013-01-17 12:38  e.e.p  阅读(2778)  评论(0编辑  收藏  举报