Updating PHP to a specific version, not the newest

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 6

Issue

  • When trying to update php to 5.3.3-23, yum upgrades to 5.3.3-27

Resolution

  • To install a specific version of a package

1) List all the versions of the package available for your system

# yum search php --showduplicates

This will give you a long list of all version of php that are compatible with your system.

php-5.3.2-6.el6.x86_64 : PHP scripting language for creating dynamic web sites
php-5.3.2-6.el6_0.1.x86_64 : PHP scripting language for creating dynamic web sites
php-5.3.3-3.el6.x86_64 : PHP scripting language for creating dynamic web sites
php-5.3.3-3.el6_1.3.x86_64 : PHP scripting language for creating dynamic web sites
php-5.3.3-3.el6_2.5.x86_64 : PHP scripting language for creating dynamic web sites
php-5.3.3-3.el6_2.6.x86_64 : PHP scripting language for creating dynamic web sites
php-5.3.3-3.el6_2.8.x86_64 : PHP scripting language for creating dynamic web sites
php-5.3.3-14.el6_3.x86_64 : PHP scripting language for creating dynamic web sites
php-5.3.3-22.el6.x86_64 : PHP scripting language for creating dynamic web sites
php-5.3.3-23.el6_4.x86_64 : PHP scripting language for creating dynamic web sites
php-5.3.3-26.el6.x86_64 : PHP scripting language for creating dynamic web sites
php-5.3.3-27.el6_5.x86_64 : PHP scripting language for creating dynamic web sites

2) Find the version need and run:

# yum install php-5.3.3-23.el6_4.x86_64

This will install the specific package php-5.3.3-23.el6_4.x86_64

---> Package php.x86_64 0:5.3.3-23.el6_4 will be installed

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.