Upgrading PHP on CentOS 6.5 (Final)

upgrade php 5.6 to 7 centos 6
how to upgrade php version in rhel 6
upgrade php 5.4 to 5.6 centos 6
install php-common centos 6
install php 7.2 centos 6
install php 5.6 centos 6
install php centos 6
install php 5.6 centos 7

I'm trying to update my PHP (currently v:5.3.3 to the latest stable PHP build) but it's not playing ball and it's saying there is nothing to update.

Any help would be useful.

Keeps saying:

No Packages marked for Update

As Jacob mentioned, the CentOS packages repo appears to only have PHP 5.3 available at the moment. But these commands seemed to work for me...

rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
yum remove php-common       # Need to remove this, otherwise it conflicts
yum install php56w
yum install php56w-mysql
yum install php56w-common
yum install php56w-pdo
yum install php56w-opcache
php --version               # Verify version has been upgraded

You can alternatively use php54w or php55w if required.

CAUTION! This may potentially break your website if it doesn't fully resolve all your dependencies, so you may need a couple of extra packages in some cases. See here for a list of other PHP 5.6 modules that are available.

If you encounter a problem and need to reset back to the default, you can use these commands:

sudo yum remove php56w
sudo yum remove php56w-common
sudo yum install php-common
sudo yum install php-mysql
sudo yum install php

(Thanks Fabrizio Bartolomucci)

how to upgrade php 5.6 to php 7 in centos 6.6, OS version is CentOS release 6.10 (Final) I tried other approach also but system is not updating to php5.6 version1 sudo yum -y upgrade php* If you want to install PHP 7.1 or PHP 7.2 on CentOS 6, just enable it as shown. yum-config-manager --enable remi-php71 yum-config-manager --enable remi-php72 Then finally install PHP 7 on CentOS 6 with all necessary PHP modules using the following command. yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo

For CentOS 6, PHP 5.3.3 is the latest version of PHP available through the official CentOS package repository. Keep in mind, even though PHP 5.3.3 was released July 22, 2010, the official CentOS 6 PHP package was updated November 24, 2013. Why? Critical bug fixes are backported. See this question for more information: "Why are outdated packages installed by yum on CentOS? (specifically PHP 5.1) How to fix?"

If you'd like to use a more recent version of PHP, Les RPM de Remi offers CentOS PHP packages via a repository that you can add to the yum package manager. To add it as a yum repository, follow the site's instructions.

Note: Questions of this variety are probably better suited for Server Fault.

How to Upgrade PHP 5.3 to PHP 5.6 on CentOS 6.7, In CentOS 6.x when you install PHP-fpm, you will get 5.3 by default, which is considered high risk as an unsupported version. unsupported-php. If you are still​  3. Upgrade PHP 5.3 to PHP 5.6. Now we can upgrade PHP. Simply type in the following command: yum -y upgrade php* Once the update has completed, let’s verify that you have PHP 5.6 installed: php -v. Should see output similar to the following:

I managed to install php54w according to Simon's suggestion, but then my sites stopped working perhaps because of an incompatibility with php-mysql or some other module. Even frantically restoring the old situation was not amusing: for anyone in my own situation the sequence is:

sudo yum remove php54w
sudo yum remove php54w-common
sudo yum install php-common
sudo yum install php-mysql
sudo yum install php

It would be nice if someone submitted the full procedure to update all the php packet. That was my production server and my heart is still rapidly beating.

How to install/upgrade PHP-FPM 5.6 on CentOS 6.x?, Restart php-fpm service and my web page is running again. Final Words. I hope that you now know how to upgrade PHP 5.6 to 7.1 on CentOS 6/7  Recently I've checked PHP's website and figured out that PHP 5.6 will EOL in the end of 2018 (that's about two months from now), I guess now is the time to upgrade my PHP version. I’ve been using the Webtatic repository for most of my servers to install PHP 5.6.

This is the easiest way that worked for me: To install PHP 5.6 on CentOS 6 or 7:

CentOS 6. Enter the following commands in the order shown:

yum -y update
yum -y install epel-release
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
wget https://centos6.iuscommunity.org/ius-release.rpm
rpm -Uvh ius-release*.rpm
yum -y update
yum -y install php56u php56u-opcache php56u-xml php56u-mcrypt php56u-gd php56u-devel php56u-mysql php56u-intl php56u-mbstring php56u-bcmath

CentOS 7. Enter the following commands in the order shown:

yum -y update
yum -y install epel-release
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
wget https://centos7.iuscommunity.org/ius-release.rpm
rpm -Uvh ius-release*.rpm
yum -y update
yum -y install php56u php56u-opcache php56u-xml php56u-mcrypt php56u-gd php56u-devel php56u-mysql php56u-intl php56u-mbstring php56u-bcmath

Sorry - I'm unable to post the source URL - due to reputation

How to Upgrade from PHP 5.6 to 7 on CentOS 6/7, Everything is in the base/updates repository. libgssapi_krb5.so.2 => krb5-libs-​1.10.3-65.el6.x86_64; libdl.so.2(GLIBC_2.2.5)(64bit)  The PHP Development Team reports the quick accessibility of PHP 5.6.0. This new version accompanies new features, some backward incompatible changes and many enhancements. Main features include in PHP 5.6.0 : Constant scalar expressions. Exponentiation utilizing the ** operator. Function and constant importing with the utilization decisive word. phpdbg as an intuitive coordinated debugger SAPI

  1. Verify current version of PHP Type in the following to see the current PHP version:

    php -v

    Should output something like:

    PHP 5.3.3 (cli) (built: Jul 9 2015 17:39:00) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

  2. Install the Remi and EPEL RPM repositories

If you haven’t already done so, install the Remi and EPEL repositories

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm && rpm -Uvh epel-release-latest-6.noarch.rpm



wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm && rpm -Uvh remi-release-6*.rpm

Enable the REMI repository globally:

nano /etc/yum.repos.d/remi.repo

Under the section that looks like [remi] make the following changes:

[remi]
name=Remi's RPM repository for Enterprise Linux 6 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/6/remi/$basearch/
mirrorlist=http://rpms.remirepo.net/enterprise/6/remi/mirror
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

Also, under the section that looks like [remi-php55] make the following changes:

[remi-php56]
name=Remi's PHP 5.6 RPM repository for Enterprise Linux 6 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/6/php56/$basearch/
mirrorlist=http://rpms.remirepo.net/enterprise/6/php56/mirror
# WARNING: If you enable this repository, you must also enable "remi"
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

Type CTRL-O to save and CTRL-X to close the editor

  1. Upgrade PHP 5.3 to PHP 5.6 Now we can upgrade PHP. Simply type in the following command:

    yum -y upgrade php*

Once the update has completed, let’s verify that you have PHP 5.6 installed:

php -v

Should see output similar to the following:

PHP 5.6.14 (cli) (built: Sep 30 2015 14:07:43) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies

Upgrading PHP 5.3 to 7.x on CentOS 6.10 (final), x and RHEL 6.x. As you know PHP is the scripting language which is used to generate dynamic web page. PHP contain HTML,Text and script blocks. When user  The good new is, if you are using CentOS 6 x86_64 or 64 bit version of CentOS 6, you can upgrade to CentOS 7 without reinstall your whole system again. ** Before we do anything, I have tested upgrading from CentOS 6 to 7 on several systems, there are risks involved. It means after upgrading, some of the services will not be 100% functional.

Easy Steps To Upgrade PHP 5.3 To PHP 5.6 On CentOS 6.x And , This article, explains how to upgrade or install a supported stable version of PHP 5.4, PHP 5.5 or PHP 5.6 on a CentOS 6 Linux distribution  A ‘upgrade PHP 5.6 to 7.1’ guide would not be complete without actually installing PHP 7.1! Now with the list of PHP packages that we previously removed, we simply copy them and edit them a bit. The ‘w’ on the end of the package means it’s Webtatic, if you’re staying with Webtatic keep the ‘w’.

How to Install PHP 5.4, PHP 5.5 or PHP 5.6 on CentOS 6, Installing PHP 7 on CentOS 7. 1. To install latest PHP 7, you need to add EPEL and Remi repository to your CentOS 6 system like so. # yum  This tutorial will show you how to upgrade PHP 5.4 to PHP 7.3 on CentOS 7.5 (1804). I’m assuming that you are running a stock installation of CentOS, and already have PHP 5.4 installed. 1. Verify current version of PHP. Type in the following to see the current PHP version: php -v. The output should match this:

How to Install PHP 7 in CentOS 6,

Comments
  • What command are you entering to update your version of PHP?
  • yum update php, I've tried a few though
  • Try yum update and see what packages yum marks for update
  • it displays: Loaded plugins: fastestmirror, replace Loading mirror speeds from cached hostfile * base: centos.mirror.triple-it.nl * epel: nl.mirror.eurid.eu * extras: centos.mirror.triple-it.nl * updates: centos.mirror.triple-it.nl * webtatic-el5: nl.repo.webtatic.com Setting up Update Process No Packages marked for Update
  • Try following these instructions. It looks like CentOS hasn't added 5.5.8 to their base repository yet: if-not-true-then-false.com/2010/…
  • In case anyone else out there needs to do this upgrade on CentOS 5, use this command instead: rpm -Uvh http://mirror.webtatic.com/yum/el5/latest.rpm
  • I get no Package php54w error. I actually get the same error for 55 and 56 too. Any idea how I can fix that?
  • as for centOs 7, here you go http://mirror.webtatic.com/yum/el7/epel-release.rpm
  • That didn't work at all for me on CentoOS 6.6. Luckely I made a snapshot before!
  • just wanted to point out that the repo suggested in this answer (webatic) is not recommended by the centos community wiki (see: wiki.centos.org/AdditionalResources/Repositories). They say " IUS or SCL are better alternatives."
  • Thanks, this is much appreciated!
  • webtatic.com also offers php 5.5/5.4 by installing this rpm. rpm -Uvh mirror.webtatic.com/yum/el6/latest.rpm