# Interworx 5.1.x - CentOS 6.7 - How to upgrade PHP 5.5 / 5.6?

**URL:** <https://forums.interworx.com/t/interworx-5-1-x-centos-6-7-how-to-upgrade-php-5-5-5-6/13988>\
**Category:** General Inquries\
**Tags:** mysql, php-upgrade, php-55, php-56\
**Created:** [April 28, 2016, 7:30pm UTC](https://forums.interworx.com/t/interworx-5-1-x-centos-6-7-how-to-upgrade-php-5-5-5-6/13988 "2016-04-28T19:30:41Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Justec](https://forums.interworx.com/letter_avatar_proxy/v4/letter/j/e47774/32.png) [@Justec](https://forums.interworx.com/u/Justec)\
**Post date:** [April 28, 2016, 7:30pm UTC](https://forums.interworx.com/t/interworx-5-1-x-centos-6-7-how-to-upgrade-php-5-5-5-6/13988/1 "2016-04-28T19:30:41Z")

</div>

I haven’t visited this in a while after upgrading to PHP 5.4 about a year ago.  
I stopped at 5.4 because of the required mysql upgrade that isn’t compatible with “old\_passwords”, which Interworx 5.0.x required.  
[More info on the old\_password issue that is no longer an issue: [http://forums.interworx.com/threads/8276-Best-way-to-move-from-php-mysql-to-php-mysqlnd](http://forums.interworx.com/threads/8276-Best-way-to-move-from-php-mysql-to-php-mysqlnd)]

So now that I’m on iworx 5.1, I’m wanting to get back into the PHP upgrade.

What have others here that are still on CentOS 6.7 done to upgrade PHP?  
What are the requirements for MySQL?

This is the thread I was working off of about a year ago: [http://forums.interworx.com/threads/8233-Which-version-of-php](http://forums.interworx.com/threads/8233-Which-version-of-php)

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![Justec](https://forums.interworx.com/letter_avatar_proxy/v4/letter/j/e47774/32.png) [@Justec](https://forums.interworx.com/u/Justec)\
**Post date:** [April 28, 2016, 10:05pm UTC](https://forums.interworx.com/t/interworx-5-1-x-centos-6-7-how-to-upgrade-php-5-5-5-6/13988/2 "2016-04-28T22:05:24Z")

</div>

Could it be as easy as this?

yum --enablerepo=remi update php56

NOTE: I have already switched mysql to mysqlnd and updated all old SiteWorx DB usernames.

---

<div class="post-metadata">

**Author:** ![d2d4j](https://forums.interworx.com/user_avatar/forums.interworx.com/d2d4j/32/16_2.png) [@d2d4j](https://forums.interworx.com/u/d2d4j)\
**Post date:** [April 28, 2016, 11:18pm UTC](https://forums.interworx.com/t/interworx-5-1-x-centos-6-7-how-to-upgrade-php-5-5-5-6/13988/3 "2016-04-28T23:18:09Z")

</div>

Hi justec

I think there is a little more that may need updating, but essentially yes, enabling remi and setting it the php version you need, should work

I would advice you do not use php 7 as yet, there are no ioncube loaders available for php 7. Of course, if you do not need ioncube, then php 7 is an option

Many thanks

John

---

<div class="post-metadata">

**Author:** ![Justec](https://forums.interworx.com/letter_avatar_proxy/v4/letter/j/e47774/32.png) [@Justec](https://forums.interworx.com/u/Justec)\
**Post date:** [April 29, 2016, 5:19am UTC](https://forums.interworx.com/t/interworx-5-1-x-centos-6-7-how-to-upgrade-php-5-5-5-6/13988/4 "2016-04-29T05:19:32Z")

</div>

Thanks John, I have no intention of upgrading past 5.6 at this point. I’m sure there are some incompatibilities with some older sites I hosts that I would have to resolve first.

Do you or anyone know if “yum --enablerepo=remi update php56” will actually update the main PHP (currently 5.4) with PHP 5.6 or will it install as a second php under PHP56?

I’m currently on a remi repo for PHP 5.4 (from my update a year ago).

---

<div class="post-metadata">

**Author:** ![d2d4j](https://forums.interworx.com/user_avatar/forums.interworx.com/d2d4j/32/16_2.png) [@d2d4j](https://forums.interworx.com/u/d2d4j)\
**Post date:** [April 29, 2016, 10:58am UTC](https://forums.interworx.com/t/interworx-5-1-x-centos-6-7-how-to-upgrade-php-5-5-5-6/13988/5 "2016-04-29T10:58:27Z")

</div>

Hi justec

Many thanks and it should update current php to 5.6.

I just thought though, you will need to add in the repository used, as I believe remi separate php repositories

I know when we updated our php on a new production server, it updated 5.3

I hope that helps a little

Many thanks

John

---

<div class="post-metadata">

**Author:** ![Justec](https://forums.interworx.com/letter_avatar_proxy/v4/letter/j/e47774/32.png) [@Justec](https://forums.interworx.com/u/Justec)\
**Post date:** [April 29, 2016, 11:20am UTC](https://forums.interworx.com/t/interworx-5-1-x-centos-6-7-how-to-upgrade-php-5-5-5-6/13988/6 "2016-04-29T11:20:28Z")

</div>

[QUOTE=d2d4j;28457]Hi justec

I just thought though, you will need to add in the repository used, as I believe remi separate php repositories

I know when we updated our php on a new production server, it updated 5.3  
[/QUOTE]

Yes, exactly right.

I was on 5.3 and have already used REMI once to upgrade to PHP 5.4.  
I had to stop at 5.4 mainly because of the old\_password issue I mentioned at the beginning of this thread.

So now that I have updated to mysqlnd and have manually deleted and recreated all my SiteWorx account database user (so they are created in the new long hash password style).

I’ve also tweaked a couple sites to not use mysql\_ function and replaced with mysqli\_. Although, it seems that mysql\_ is only deprecated in 5.5+, not removed. That doesn’t happen until PHP 7.0.  
So technically the sites would still work with mysql\_, it would just throw some warnings (that you can just hide).

So I will be giving this a try later tonight here on the east coast. Hopefully all the sites run smoothly on the new version and if not I will try out the yum downgrade feature to go back to 5.4.

Thanks again for the feedback, good to confirm that this PHP56 will replace my current PHP54.

One More Questions though…

Is it better to run:  
yum --enablerepo=remi update php56

Or:

yum --enablerepo=remi upgrade php56

---

<div class="post-metadata">

**Author:** ![d2d4j](https://forums.interworx.com/user_avatar/forums.interworx.com/d2d4j/32/16_2.png) [@d2d4j](https://forums.interworx.com/u/d2d4j)\
**Post date:** [April 29, 2016, 12:07pm UTC](https://forums.interworx.com/t/interworx-5-1-x-centos-6-7-how-to-upgrade-php-5-5-5-6/13988/7 "2016-04-29T12:07:17Z")

</div>

Hi Justin

I used the below for updating, so it updated all I needed, but I had to amend for PHP56, which remi repositories are seperate now, see pic, so you may have to lookup the correct resporitory, and amend as needed.  
It was straight forward to do though, and I do not think you can yum downgrade (coudlbe wrong so appologies in advance), I think you just install for php54 if going backwards.  
I hope that helps and appreciate if you could uodate post with your experience of how it went  
Many thanks  
John  
wget [http://download.fedoraproject.org/pub/epel/6/x86\_64/epel-release-6-8.noarch.rpm](http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm)  
rpm -ivh epel-release-6-8.noarch.rpm  
wget [http://rpms.famillecollet.com/enterprise/remi-release-6.rpm](http://rpms.famillecollet.com/enterprise/remi-release-6.rpm)  
rpm -Uvh remi-release-6\*.rpm  
yum --enablerepo=remi upgrade php-mysql php-devel php-gd php-pecl-memcache php-pspell php-snmp php-xmlrpc php-xml php-mcrypt php-mailparse php-imap -y  
yum --enablerepo=epel install php-pecl-mailparse  
yum --enablerepo=remi install php-mailparse -y  
yum --enablerepo=remi install php-imap -y

 ![remi repositories.png](https://forums.interworx.com/uploads/default/original/1X/8673a76ada288236e3ea7da51ecbb5f5219ffffe.png)

---

<div class="post-metadata">

**Author:** ![Justec](https://forums.interworx.com/letter_avatar_proxy/v4/letter/j/e47774/32.png) [@Justec](https://forums.interworx.com/u/Justec)\
**Post date:** [April 29, 2016, 12:26pm UTC](https://forums.interworx.com/t/interworx-5-1-x-centos-6-7-how-to-upgrade-php-5-5-5-6/13988/8 "2016-04-29T12:26:44Z")

</div>

Because of my PHP 5.3 to 5.4, I already have all the REMI repos in place:

```auto
[root@server1 home]# yum --enablerepo=remi info php56
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * remi: mirror.uta.edu.ec
remi | 2.9 kB 00:00
remi/primary_db | 1.4 MB 00:05
Available Packages
Name : php56
Arch : x86_64
Version : 2.1
Release : 5.el6.remi
Size : 3.5 k
Repo : remi
Summary : Package that installs PHP 5.6
License : GPLv2+
Description : This is the main package for php56 Software Collection,
            : that install PHP 5.6 language.

```

[QUOTE=d2d4j;28459]  
yum --enablerepo=remi upgrade php-mysql php-devel php-gd php-pecl-memcache php-pspell php-snmp php-xmlrpc php-xml php-mcrypt php-mailparse php-imap -y  
yum --enablerepo=epel install php-pecl-mailparse  
yum --enablerepo=remi install php-mailparse -y  
yum --enablerepo=remi install php-imap -y[/QUOTE]

So when I do the upgrade I have to specify all the individual packages to update as well?

Also, I see you just say “upgrade”, but you have PHP56 enabled in your repo.  
I have those all turned off which is why I was going to do:  
yum --enablerepo=remi upgrade php56

And because you have your remi php56 Enabled in NodeWorx image, I don’t think you even have to do “–enablerepo=remi” right?  
Also, you don’t seem to have php in that upgrade list? How does that get updated?

 ![remi.jpg](https://forums.interworx.com/uploads/default/original/1X/a9cb36a8323767ce7be3392ce01130c7ee0b5216.jpeg)

---

<div class="post-metadata">

**Author:** ![Justec](https://forums.interworx.com/letter_avatar_proxy/v4/letter/j/e47774/32.png) [@Justec](https://forums.interworx.com/u/Justec)\
**Post date:** [April 29, 2016, 12:45pm UTC](https://forums.interworx.com/t/interworx-5-1-x-centos-6-7-how-to-upgrade-php-5-5-5-6/13988/9 "2016-04-29T12:45:09Z")

</div>

I found this link:

> **[How to Upgrade PHP 5.3 to PHP 5.6 on CentOS 6.7 - ZeroStopBits](https://www.zerostopbits.com/how-to-upgrade-php-5-3-to-php-5-6-on-centos-6-7/)**
>
> In this article, I'm going to show you how to upgrade PHP 5.3 to PHP 5.6 on CentOS 6.7. This article assumes you have a stock installation of CentOS, and that y

Basically it says to enable the main [remi] in the /etc/yum.repos.d/remi.repo file.  
Then also to enable the [remi-php56].

After those are enabled then you just do yum -y upgrade php\*

No need to the enable repo because it’s already enabled.

* * *

You can also do yum install php56 to install a parallel version, versus updating the core PHP.

---

<div class="post-metadata">

**Author:** ![d2d4j](https://forums.interworx.com/user_avatar/forums.interworx.com/d2d4j/32/16_2.png) [@d2d4j](https://forums.interworx.com/u/d2d4j)\
**Post date:** [April 29, 2016, 2:04pm UTC](https://forums.interworx.com/t/interworx-5-1-x-centos-6-7-how-to-upgrade-php-5-5-5-6/13988/10 "2016-04-29T14:04:20Z")

</div>

Hi Justin

Many thanks, and your correct in your post

I’m sorry, I used mikes upgrade details, (licensecart) and meant to state that, but time is getting late here, rushed and missed it off sorry.

Also, I upgraded a clean install from IW on php5.3

Your also correct about running different versions of php, but I’m trying to think who posted how to do this, it might have been you but it’s a few years ago and you manually set the php, it is not set by IW for a different php version

Would still hope you post how it went for you if you don’t mind

Many thanks

John

---

<div class="post-metadata">

**Author:** ![Justec](https://forums.interworx.com/letter_avatar_proxy/v4/letter/j/e47774/32.png) [@Justec](https://forums.interworx.com/u/Justec)\
**Post date:** [April 29, 2016, 2:11pm UTC](https://forums.interworx.com/t/interworx-5-1-x-centos-6-7-how-to-upgrade-php-5-5-5-6/13988/11 "2016-04-29T14:11:16Z")

</div>

Yes I will post later. My plan is to just enabled the [remi-php56] and run yum update.  
I may also do the [remi] repo at some point, to get my mysql up to date.

And you can actually do all these updates (once remi is install on the system) from NodeWorx.

Here is a snap shot of the section “Check Updates” with both [remi] and [remi-php56] enabled via NodeWorx.

If you look at the bottom of that screen shot, you can check off the updates you want and then select Install Updates.

I guess you could also just let the iworx-daily cron run and it would update those as well (I think).

I’ll post back after I try it a little bit later tonight EST, just in case I have to make some tweaks to websites after the update.

 ![remi-updates.jpg](https://forums.interworx.com/uploads/default/original/1X/a4464ef951c6c9bd3ba8c008cd12eab14c603b51.jpeg)

---

<div class="post-metadata">

**Author:** ![Justec](https://forums.interworx.com/letter_avatar_proxy/v4/letter/j/e47774/32.png) [@Justec](https://forums.interworx.com/u/Justec)\
**Post date:** [April 29, 2016, 9:02pm UTC](https://forums.interworx.com/t/interworx-5-1-x-centos-6-7-how-to-upgrade-php-5-5-5-6/13988/12 "2016-04-29T21:02:05Z")

</div>

Upgrade went well!

Preparing a couple old sites to use mysqli vs mysql DB connection definitely was a good idea.  
Although, the pages still work fine with the error message visible on the page. You can suppress the deprecated warnings by using ini\_set(‘display\_errors’, ‘0’); though.

I tried to do the yum upgrade without enabling [remi], but got the following errors

```auto
Error: Package: php-pecl-zip-1.13.2-1.el6.remi.5.6.x86_64 (remi-php56)
           Requires: libzip.so.4()(64bit)
Error: Package: php-gd-5.6.21-1.el6.remi.x86_64 (remi-php56)
           Requires: libgd.so.3()(64bit)
Error: Package: php-gd-5.6.21-1.el6.remi.x86_64 (remi-php56)
           Requires: gd-last(x86-64) >= 2.1.1
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

```

Enabling the main [remi] (in addition to [remi-php56]) I was then able to do the upgrade. I needed to update mysql anyway I guess 🙂

So all I did was enable those two repos and then do a “yum upgrade”

I did have a bunch of warnings spit out during the update like this

```auto
PHP Warning: PHP Startup: json: Unable to initialize module
Module compiled with module API=20131226
PHP compiled with module API=20100525
These options need to match
 in Unknown on line 0

```

But didn’t seem to effect anything.

---

<div class="post-metadata">

**Author:** ![d2d4j](https://forums.interworx.com/user_avatar/forums.interworx.com/d2d4j/32/16_2.png) [@d2d4j](https://forums.interworx.com/u/d2d4j)\
**Post date:** [April 30, 2016, 12:34am UTC](https://forums.interworx.com/t/interworx-5-1-x-centos-6-7-how-to-upgrade-php-5-5-5-6/13988/13 "2016-04-30T00:34:18Z")

</div>

Hi Justin

Glad it went well and thanks for the updated post

I could be wrong sorry, but did you update ioncube for php56

I’m thinking your module error is ioncube for old php version

I know licensecart has a lovely ioncube loader installer, which does the work for you for the correct php version you have installed

I hope that helps and apologies in advance if I’m wrong and you have updated ioncube

Many thanks

John

---

<div class="post-metadata">

**Author:** ![Justec](https://forums.interworx.com/letter_avatar_proxy/v4/letter/j/e47774/32.png) [@Justec](https://forums.interworx.com/u/Justec)\
**Post date:** [May 3, 2016, 3:45pm UTC](https://forums.interworx.com/t/interworx-5-1-x-centos-6-7-how-to-upgrade-php-5-5-5-6/13988/14 "2016-05-03T15:45:48Z")

</div>

[QUOTE=d2d4j;28465]I could be wrong sorry, but did you update ioncube for php56

I’m thinking your module error is ioncube for old php version[/quote]

Thanks for the thought, but I didn’t have ioncube running on my PHP 5.4 and didn’t set it up for PHP 5.6, so don’t think that could be an issue.

Although, everything is running fine, so maybe the warnings with the modules were fixed in real time by updating those modules.

---

<div class="post-metadata">

**Author:** ![Justec](https://forums.interworx.com/letter_avatar_proxy/v4/letter/j/e47774/32.png) [@Justec](https://forums.interworx.com/u/Justec)\
**Post date:** [May 3, 2016, 3:51pm UTC](https://forums.interworx.com/t/interworx-5-1-x-centos-6-7-how-to-upgrade-php-5-5-5-6/13988/15 "2016-05-03T15:51:55Z")

</div>

Apparently this is normal

> **[Warning lors de la mise à jour PHP 5.4.45 vers 5.6.14 (Page 1) — User support...](https://forum.remirepo.net/viewtopic.php?id=3311)**
>
> Warning lors de la mise à jour PHP 5.4.45 vers 5.6.14 (Page 1) — User support — Remi's RPM repository - Forum — Discussion & Assistance

> Pas de probl?me c’est normal.  
> Changement d’API donc pendant la MAJ on est le “cul entre 2 chaises”  
> A la fin de l’installation si “php -v” retourne la bonne version sans message, c’est que c’est bon.

which Google translates to

> No problem this is normal.  
> API change so during the shift we are the “ass between two chairs”  
> At the end of the installation if “php -v” returns the correct version with no message is that it’s good.
