首页 > RedHat/CentOS操作系统 > Centos yum安装php5.2

Centos yum安装php5.2

2015年9月17日

Centos yum安装php5.2
http://blog.sina.com.cn/s/blog_907043b30102uwyu.html
由于linux默认yum源安装的是php 5.1的包,
yum安装php以后查看

rpm -qa php

php-5.1.6-23.2.el5_3

由于有的程序需要使用php5.2以上的版本

于是就找起了资料,终于找到有介绍如下添加一个额外的源:

# rpm –import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
# gedit /etc/yum.repos.d/utterramblings.repo
或者直接修改/etc/yum.repos.d/utterramblings.repo 名字可以自己定义要以.repo结尾如abc.repo

在打开的文件中加入以下内容:

[abc]
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 如图所示 ,

# yum update php
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
utterramblings | 951 B 00:00
utterramblings/primary | 39 kB 00:03
utterramblings 140/140
Skipping security plugin, no data
Setting up Update Process
Resolving Dependencies
Skipping security plugin, no data
–> Running transaction check
–> Processing Dependency: php = 5.1.6-23.2.el5_3 for package: php-devel
—> Package php.i386 0:5.2.16-jason.1 set to be updated
–> Processing Dependency: php-common = 5.2.16-jason.1 for package: php
–> Processing Dependency: php-cli = 5.2.16-jason.1 for package: php
–> Running transaction check
—> Package php-cli.i386 0:5.2.16-jason.1 set to be updated
。。。。。。。。
已经有新的php包尅更新
================================================================================

Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Updating:
php x86_64 5.2.17-jason.2 abc 3.8 M
Installing for dependencies:
mysqlclient15 x86_64 5.0.91-1.jason.1 abc 2.0 M
Updating for dependencies:
asterisk x86_64 2009020507:11.10.0-0 elastix-updates 20 M
asterisk-addons x86_64 2009020507:11.10.0-0 elastix-updates 529 k
asterisk-devel x86_64 2009020507:11.10.0-0 elastix-updates 421 k
libgsmat x86_64 2.0.8-0 elastix-updates 46 k
mysql x86_64 5.1.58-jason.1 abc 3.5 M
mysql-server x86_64 5.1.58-jason.1 abc 13 M
php-cli x86_64 5.2.17-jason.2 abc 2.6 M
php-common x86_64 5.2.17-jason.2 abc 522 k
php-devel x86_64 5.2.17-jason.2 abc 558 k
php-gd x86_64 5.2.17-jason.2 abc 348 k
php-imap x86_64 5.2.17-jason.2 abc 115 k
php-mbstring x86_64 5.2.17-jason.2 abc 1.4 M
php-mysql x86_64 5.2.17-jason.2 abc 280 k
php-pdo x86_64 5.2.17-jason.2 abc 169 k
php-soap x86_64 5.2.17-jason.2 abc 365 k
php-xml x86_64 5.2.17-jason.2 abc 343 k
Transaction Summary
================================================================================
Install 1 Package(s)
Upgrade 17 Package(s)
Total size: 49 M
Total download size: 20 M
安装 后 重启apache
查看php 目前安装版本
# rpm -qa php
php-5.2.17-jason.2

安装已经完成 还可以使用php -m 查看php支持的模块
如]# php -m | grep mysql
mysql
mysqli
pdo_mysql

我的是linux系统是elastix
这个网上方法的,不过我只想升级php,就有点烦,有没有好的建议?

分类: RedHat/CentOS操作系统 标签:
本文的评论功能被关闭了.