Headaches with CentOS6.6 – Solution to PHP5.5+ repo

So today I was trying to run a simple explode file contents php function with my centos 6.6 machine, to realise that it threw:

Error, unexpected ‘[‘ on line 7.

As usual when you run into annoying software outdated issues you try the usual yum upgrade’s and fixing dependencies.

I beat around the bush with multiple online sources to fix yum related issues when trying to force install of PHP5.6, including the apparently infamous xz compression due to epel version issues:

[[email protected] data]# yum remove epel-release

Loaded plugins: fastestmirror, security
Setting up Remove Process

webtatic: us-east.repo.webtatic.com
Error: xz compression not available

So the solution to upgrading to PHP5.6 on Centos6.6 is quite easy once I fixed it all up. Firstly you want to run the following 3 commands to add REMI to your repo listing:

wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm;wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm;rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm


Then proceed to activate this repo addition by running “nano /etc/yum.repos.d/” and editing the following lines:

[remi]

enabled=0 set to 1

[remi-php56]

enabled=0 set to 1 unless you want version 5.5 which is above php56.

You can then finally run “yum install php” to upgrade to PHP5.6. Make sure you’ve removed all old php versions or you’ll get conflicts!

 

One Comment

Leave a Reply

Your email address will not be published.