方法如下:
修改檔案:/etc/yum.repos.d/CentOS-Base.repo
在檔案最後添加了以下設定
QUOTE:
[c5-testing]上述設定網址都指向官方網站,可以放心更新 PHP。存檔後,下達更新命令:
name=CentOS-5 Testing
baseurl=http://dev.centos.org/centos/5/testing/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing
# yum update php*
更新完畢後以 PHP命令檢視版本:
QUOTE:
# php -v但升級之後發現,有時執行 php 的 program 時會出現以下 error
PHP 5.2.10 (cli) (built: Nov 13 2009 11:24:03)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
with Zend Extension Manager v1.0.11, Copyright (c) 2003-2006, by Zend Technologies
with Zend Optimizer v3.2.0, Copyright (c) 1998-2006, by Zend Technologies
QUOTE:
PHP Warning: PHP Startup: fileinfo: Unable to initialize module原因係 extension library 根本無 upgrade 過,所以要作出以下更新
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
in Unknown on line 0
PHP Warning: Module 'readline' already loaded in Unknown on line 0
QUOTE:
yum upgrade php-mcrypt更新之後 readline extension還是會出現以下 Error
pecl install fileinfo readline memcache
pecl install imagick
pecl install readline
PHP Warning: Module 'readline' already loaded in Unknown on line 0
可以到 /etc/php.d/readline.ini 裡面 將 “extension=readline.so” 這一句mark 掉
如下所示:
QUOTE:
; Enable readline extension module因為可能是 compile PHP 時已經直接 compile 在 readline 核心,這樣整個升級過程就都ok囉
; extension=readline.so