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:
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:
Loaded plugins: fastestmirror, security
Setting up Remove Process
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:
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!