Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upgrading PHP on CentOS 6.5 (Final)

Tags:

php

yum

centos6

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

like image 631
BCLtd Avatar asked Feb 01 '14 19:02

BCLtd


People also ask

How do I upgrade to a newer version of PHP?

Navigate to the App and then click on Settings > PHP. Change to a newer PHP version and hit "save" Check if your website is still working after a few minutes. You can safely switch back the version if it doesn't work.

How do I upgrade PHP to 7?

The simplest way to upgrade to PHP 7 is by asking your hosting company to update it for your account. Of course, this means you'll need to be working with a hosting company that supports PHP 7 in the first place. Some companies make it easier to upgrade to PHP 7 than others.


1 Answers

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)

like image 156
Simon East Avatar answered Oct 01 '22 02:10

Simon East