Shay Anderson Software
SHAYANDERSON
  • About
  • Projects
  • Contact
Xap is a new rapid PHP-MySQL development engine that offers simple shorthand syntax, pagination, ORM, caching   Learn More

CentOS 5 or CentOS 6 Upgrade PHP to PHP 5.4 or PHP 5.5

By Shay Anderson on August 2013
Knowledge Base  /  Linux  /  CentOS 5 or CentOS 6 Upgrade PHP to PHP 5.4 or PHP 5.5
This article describes how to upgrade to PHP 5.4 or PHP 5.5 on a CentOS 5 or CentOS 6 server.
  1. First, detect if any PHP packages are installed:
    # yum list installed | grep phpIf packages are installed remove them, for example:
    # 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 packages to yum using this command for CentOS 5.x
    # rpm -Uvh http://mirror.webtatic.com/yum/el5/latest.rpmOr, for CentOS 6.x:
    # rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
    Now, you can check if the new PHP (5.4: php54w or 5.5: php55w) packages are available:
    # yum list available | grep phpOr, version specific search:
    # yum list available | grep php54
  3. 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
    PHP should now be upgraded to the new version, you can verify with the command:
    # 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

  4. Finally, restart the Web server: # service httpd restart
Contact
Contact

Contact us today for a free quote or software consulting

Explore
Recent Projects
Check out recent programming and software development projects
Knowledge Base
View recent technology topics and notes
Get a Quote
Want a quote for software development?
SHAYANDERSON

Enterprise Software / Database / Server

Software Engineer, PHP Programmer
& Web App Developer in Tampa Bay, Florida
Copyright © 2022 ShayAnderson.com
All Rights Reserved