Centos – How to reinstall or downgrade PHP on Centos

centosPHPyum

Having used the atomic repository for a couple of years to update my Centos (6.8) and Plesk 12, I required an update to PHP that wasn't yet available.

I added the remi repos and updated PHP to 5.5.38 to discover a few errors in PHP. Rather than trying to debug this and many others (and because an update to PHP 5.6 is now available) I would like to reinstall PHP from atomic.

Is this just a simple case of yum remove php-* and reinstalling from Atomic or is there any issues I am likely to encounter. Don't want to break it all.

Best Answer

Generally, it is not good practice to mix and match different repositories. Anyway, try the following:

  • with the remi repo enabled, do a yum remove php* (pay big attention to the list of to-be-removed packages to be sure no critical packages are uninstalled)
  • disable the remi repo and enable the atomic one
  • do a yum install php
  • restart apache with service httpd restart
Related Topic