2015-03-17

Upgrade PHP5.4.0 from PHP5.2.10 on CentOS 5.5

5 Steps

1- Remove older version of PHP 5.2.10.
2- Add PHP 5.4
3- Check available PHP
4- Install new PHP
5- Finally



1- Remove older version of PHP 5.2.10.
  • Detect if any PHP packages are installed.
    • # yum list installed | grep php
  • If packages are installed remove them.
    • # yum remove php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64 php-ldap.x86_64 php-mbstring.x86_64 php-mcrypt.x86_64 php-mysql.x86_64 php-pdo.x86_64
2- Add PHP 5.4
  • Add PHP 5.4 packages to yum using this command for CentOS 5.x.
    • # rpm -Uvh http://mirror.webtatic.com/yum/el5/latest.rpm
  • Or CentOS 6.x
    • # rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
3- Check available PHP
  • Now, you can check if the new PHP (5.4: php54w or 5.5: php55w) packages are available: 
    • # yum list available | grep php
  • Or version specific search
    • # yum list available | grep php54
4- Install new PHP
  • Next, install the new PHP 5.4 or 5.5 packages, for example when installing PHP 5.4 packages I used: 
    • # yum install php54w.x86_64 php54w-cli.x86_64 php54w-common.x86_64 php54w-gd.x86_64 php54w-ldap.x86_64 php54w-mbstring.x86_64 php54w-mcrypt.x86_64 php54w-mysql.x86_64 php54w-pdo.x86_64
  • Current PHP version check
    • # php -v 
      • PHP 5.4.17 (cli) (built: Jul 23 2013 00:02:04) 
      • Copyright (c) 1997-2013 The PHP Group 
      • Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
5- Finally
  • Restart the Web service.
    • # service httpd restart

沒有留言:

張貼留言