Upgrading PHP 5.3 to 5.6 (CentOS 6.8)

Hi,

We are running CentOS 6.8, which comes with php v5.3 which is out of date now. How do we upgrade to v5.6?

Thank you.

1 Reply

Hello!

The official CentOS 6 repos don't have anything above v5.3, however it appears there are some third party repos that offer 5.6 (and above).

In researching this, I deployed a Linode with CentOS 6.8 and installed PHP:

yum install php

php -v
PHP 5.3.3 (cli) (built: Mar 22 2017 12:27:09)

I found this guide that details upgrading to 5.6 from 5.3

Guide

After following the steps to install the remi repos and editing the .repo file as directed, I did the upgrade:

yum -y upgrade php*

And checked again

php -v
PHP 5.6.40 (cli) (built: Jul  3 2019 07:08:28)

So, this guide worked very easily for getting to 5.6 for me. I'm not sure what your particular requirements are for going to 5.6, but these repos will allow for upgrade to a more recent version as well.

I followed this guide to upgrade to v7.0

yum install yum-utils

After installing yum-utils, I upgraded to 7.0 (the other options like 7.1 also worked for me)

yum-config-manager --enable remi-php70

yum -y upgrade php*

php -v
PHP 7.0.33 (cli) (built: Jul  2 2019 18:47:44) ( NTS )

Hopefully this helps!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct