背景:
ThinkPHP3.2 需要5.3+的php版本,而kloxo的php还是5.2.17的
kloxo官方目前可用的PHP版本:
php-pdo-5.2.17-13
php-5.2.17-13
php-mysql-5.2.17-13
php-devel-5.2.17-13
php-pear-1.4.9-8.el5
php-xml-5.2.17-13
php-common-5.2.17-13
php-cli-5.2.17-13
lxphp-5.2.1-400
php-imap-5.2.17-13
php-mbstring-5.2.17-13
php-gd-5.2.17-13
php-mcrypt-5.2.17-13
所以需要手动升级
过程:
- 移除掉PHP
- yum remove php
- 移除掉公共包
- yum remove php-common
- 安装php 5.3
- yum install php53
- 安装mysql支持库
- yum install php53-mysql
- 不然web会提示mysql不可用
- 安装xml支持库
- yum install php53-xml
- 不然会出现找不到dom啥的
- 安装gd支持库
- yum install php53-gd
- 不然验证码插件使用不了
整个过程:
[root@hesiwei /]# php -v
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/xsl.so' - /usr/lib/libexslt.so.0: symbol gcry_cipher_setkey, version GCRYPT_1.2 not defined in file libgcrypt.so.11 with link time reference in Unknown on line 0
PHP 5.2.17 (cli) (built: Feb 16 2012 23:29:39)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
with the ionCube PHP Loader v4.0.14, Copyright (c) 2002-2011, by ionCube Ltd., and
with Zend Extension Manager v1.2.0, Copyright (c) 2003-2007, by Zend Technologies
with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies
[root@hesiwei /]# cd /
[root@hesiwei /]# rpm -qa | grep -i php
php-pdo-5.2.17-13
php-5.2.17-13
php-mysql-5.2.17-13
php-devel-5.2.17-13
php-pear-1.4.9-8.el5
php-xml-5.2.17-13
php-common-5.2.17-13
php-cli-5.2.17-13
lxphp-5.2.1-400
php-imap-5.2.17-13
php-mbstring-5.2.17-13
php-gd-5.2.17-13
php-mcrypt-5.2.17-13
[root@hesiwei /]# yum remove php
Loaded plugins: fastestmirror, protectbase
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package php.i386 0:5.2.17-13 set to be erased
--> Processing Dependency: php = 5.2.17-13 for package: php-devel
--> Running transaction check
---> Package php-devel.i386 0:5.2.17-13 set to be erased
--> Processing Dependency: php-devel for package: php-pear
--> Running transaction check
---> Package php-pear.noarch 1:1.4.9-8.el5 set to be erased
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Removing:
php i386 5.2.17-13 installed 9.1 M
Removing for dependencies:
php-devel i386 5.2.17-13 installed 2.7 M
php-pear noarch 1:1.4.9-8.el5 installed 1.8 M
Transaction Summary
================================================================================
Install 0 Package(s)
Update 0 Package(s)
Remove 3 Package(s)
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Erasing : php-devel [1/3]
Erasing : php [2/3]
Erasing : php-pear [3/3]
Removed: php.i386 0:5.2.17-13
Dependency Removed: php-devel.i386 0:5.2.17-13 php-pear.noarch 1:1.4.9-8.el5
Complete!
[root@hesiwei /]# yum remove php-common
Loaded plugins: fastestmirror, protectbase
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package php-common.i386 0:5.2.17-13 set to be erased
--> Processing Dependency: php-common = 5.2.17-13 for package: php-mbstring
--> Processing Dependency: php-common = 5.2.17-13 for package: php-cli
--> Processing Dependency: php-common = 5.2.17-13 for package: php-mysql
--> Processing Dependency: php-common = 5.2.17-13 for package: php-xml
--> Processing Dependency: php-common = 5.2.17-13 for package: php-pdo
--> Processing Dependency: php-common = 5.2.17-13 for package: php-mcrypt
--> Processing Dependency: php-common = 5.2.17-13 for package: php-gd
--> Processing Dependency: php-common = 5.2.17-13 for package: php-imap
--> Running transaction check
---> Package php-mysql.i386 0:5.2.17-13 set to be erased
---> Package php-mcrypt.i386 0:5.2.17-13 set to be erased
---> Package php-mbstring.i386 0:5.2.17-13 set to be erased
---> Package php-pdo.i386 0:5.2.17-13 set to be erased
---> Package php-xml.i386 0:5.2.17-13 set to be erased
---> Package php-gd.i386 0:5.2.17-13 set to be erased
---> Package php-cli.i386 0:5.2.17-13 set to be erased
--> Processing Dependency: php-cli for package: spawn-fcgi
---> Package php-imap.i386 0:5.2.17-13 set to be erased
--> Running transaction check
---> Package spawn-fcgi.i386 0:1.6.3-1 set to be erased
--> Processing Dependency: spawn-fcgi for package: lighttpd-fastcgi
--> Running transaction check
---> Package lighttpd-fastcgi.i386 0:1.4.32-1 set to be erased
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Removing:
php-common i386 5.2.17-13 installed 1.6 M
Removing for dependencies:
lighttpd-fastcgi i386 1.4.32-1 installed 133 k
php-cli i386 5.2.17-13 installed 6.5 M
php-gd i386 5.2.17-13 installed 911 k
php-imap i386 5.2.17-13 installed 234 k
php-mbstring i386 5.2.17-13 installed 2.6 M
php-mcrypt i386 5.2.17-13 installed 84 k
php-mysql i386 5.2.17-13 installed 629 k
php-pdo i386 5.2.17-13 installed 350 k
php-xml i386 5.2.17-13 installed 1.1 M
spawn-fcgi i386 1.6.3-1 installed 21 k
Transaction Summary
================================================================================
Install 0 Package(s)
Update 0 Package(s)
Remove 11 Package(s)
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Erasing : php-imap [ 1/11]
Erasing : php-common [ 2/11]
warning: /etc/php.ini saved as /etc/php.ini.rpmsave
Erasing : php-xml [ 3/11]
Erasing : lighttpd-fastcgi [ 4/11]
Erasing : php-mysql [ 5/11]
Erasing : php-pdo [ 6/11]
Erasing : php-gd [ 7/11]
Erasing : php-mbstring [ 8/11]
Erasing : php-cli [ 9/11]
Erasing : spawn-fcgi [10/11]
Erasing : php-mcrypt [11/11]
Removed: php-common.i386 0:5.2.17-13
Dependency Removed: lighttpd-fastcgi.i386 0:1.4.32-1 php-cli.i386 0:5.2.17-13 php-gd.i386 0:5.2.17-13 php-imap.i386 0:5.2.17-13 php-mbstring.i386 0:5.2.17-13 php-mcrypt.i386 0:5.2.17-13 php-mysql.i386 0:5.2.17-13 php-pdo.i386 0:5.2.17-13 php-xml.i386 0:5.2.17-13 spawn-fcgi.i386 0:1.6.3-1
Complete!
[root@hesiwei /]# yum install php53
Loaded plugins: fastestmirror, protectbase
Determining fastest mirrors
* epel: mirrors.kernel.org
* base: centos.mirror.lstn.net
* updates: mirror-centos.hostingswift.com
* addons: mirrordenver.fdcservers.net
* extras: centos.mirror.ndchost.com
epel | 3.6 kB 00:00
74df183ee7ab2da855443ad8995fffb1f665644a-primary.sqlite. | 3.2 MB 00:00
lxcenter-updates | 951 B 00:00
primary.xml.gz | 79 kB 00:00
lxcenter-updates 252/252
lxcenter-extra | 951 B 00:00
base | 1.1 kB 00:00
updates | 1.9 kB 00:00
primary.sqlite.bz2 | 186 kB 00:00
addons | 1.9 kB 00:00
extras | 2.1 kB 00:00
0 packages excluded due to repository protections
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package php53.i386 0:5.3.3-22.el5_10 set to be updated
--> Processing Dependency: php53-cli = 5.3.3-22.el5_10 for package: php53
--> Processing Dependency: php53-common = 5.3.3-22.el5_10 for package: php53
--> Running transaction check
---> Package php53-cli.i386 0:5.3.3-22.el5_10 set to be updated
---> Package php53-common.i386 0:5.3.3-22.el5_10 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
php53 i386 5.3.3-22.el5_10 updates 1.3 M
Installing for dependencies:
php53-cli i386 5.3.3-22.el5_10 updates 2.5 M
php53-common i386 5.3.3-22.el5_10 updates 606 k
Transaction Summary
================================================================================
Install 3 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 4.4 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): php53-common-5.3.3-22.el5_10.i386.rpm | 606 kB 00:00
(2/3): php53-5.3.3-22.el5_10.i386.rpm | 1.3 MB 00:00
(3/3): php53-cli-5.3.3-22.el5_10.i386.rpm | 2.5 MB 00:00
--------------------------------------------------------------------------------
Total 2.1 MB/s | 4.4 MB 00:02
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : php53-common [1/3]
Installing : php53-cli [2/3]
Installing : php53 [3/3]
Installed: php53.i386 0:5.3.3-22.el5_10
Dependency Installed: php53-cli.i386 0:5.3.3-22.el5_10 php53-common.i386 0:5.3.3-22.el5_10
Complete!
[root@hesiwei /]# yum install php53-mysql
Loaded plugins: fastestmirror, protectbase
Loading mirror speeds from cached hostfile
* epel: mirrors.kernel.org
* base: centos.mirror.lstn.net
* updates: mirror-centos.hostingswift.com
* addons: mirrordenver.fdcservers.net
* extras: centos.mirror.ndchost.com
0 packages excluded due to repository protections
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package php53-mysql.i386 0:5.3.3-22.el5_10 set to be updated
--> Processing Dependency: php53-pdo for package: php53-mysql
--> Running transaction check
---> Package php53-pdo.i386 0:5.3.3-22.el5_10 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
php53-mysql i386 5.3.3-22.el5_10 updates 89 k
Installing for dependencies:
php53-pdo i386 5.3.3-22.el5_10 updates 68 k
Transaction Summary
================================================================================
Install 2 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 157 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): php53-pdo-5.3.3-22.el5_10.i386.rpm | 68 kB 00:00
(2/2): php53-mysql-5.3.3-22.el5_10.i386.rpm | 89 kB 00:00
--------------------------------------------------------------------------------
Total 195 kB/s | 157 kB 00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : php53-pdo [1/2]
Installing : php53-mysql [2/2]
Installed: php53-mysql.i386 0:5.3.3-22.el5_10
Dependency Installed: php53-pdo.i386 0:5.3.3-22.el5_10
Complete!
[root@hesiwei /]# yum install php53-gd
Loaded plugins: fastestmirror, protectbase
Loading mirror speeds from cached hostfile
* epel: mirrors.kernel.org
* base: centos.mirror.lstn.net
* updates: mirror-centos.hostingswift.com
* addons: mirrordenver.fdcservers.net
* extras: centos.mirror.ndchost.com
0 packages excluded due to repository protections
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package php53-gd.i386 0:5.3.3-22.el5_10 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
php53-gd i386 5.3.3-22.el5_10 updates 111 k
Transaction Summary
================================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 111 k
Is this ok [y/N]: y
Downloading Packages:
php53-gd-5.3.3-22.el5_10.i386.rpm | 111 kB 00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : php53-gd [1/1]
Installed: php53-gd.i386 0:5.3.3-22.el5_10
Complete!
[root@hesiwei /]# yum install php53-xml
Loaded plugins: fastestmirror, protectbase
Loading mirror speeds from cached hostfile
* epel: mirrors.kernel.org
* base: centos.mirror.lstn.net
* updates: mirror-centos.hostingswift.com
* addons: mirrordenver.fdcservers.net
* extras: centos.mirror.ndchost.com
0 packages excluded due to repository protections
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package php53-xml.i386 0:5.3.3-22.el5_10 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
php53-xml i386 5.3.3-22.el5_10 updates 115 k
Transaction Summary
================================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 115 k
Is this ok [y/N]: y
Downloading Packages:
php53-xml-5.3.3-22.el5_10.i386.rpm | 115 kB 00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : php53-xml [1/1]
Installed: php53-xml.i386 0:5.3.3-22.el5_10
Complete!