I am trying to upgrade the PHP version on a Digital Ocean server from 5.6.19 to the latest PHP 7.2. A lot of instructions found online point to "php72", which makes me wonder if 5.6.19 will be seamlessly replaced with a yum update php. I doubt it.

Which means I may have to first 5.6.19, in which case I run the risk of totally deleting old settings. This is scary in case th enew setup does not go well, there's not much to flip back to.

I find there are important settings in these places:

  1. /etc/php-fpm.d/www.conf
  2. /etc/php.ini
  3. /etc/php-fpm.conf
  4. /etc/nginx/common.conf
  5. /etc/nginx/fastcgi.conf

And of course the Nginx.conf (the main Ngnix config file) has calls to PHP-FPM accordingly. They include the #4 file above, common.conf, which in turn includes the fastcgi.conf.

Instructions on external websites, such as this one-- https://www.cyberciti.biz/faq/how-to-install-php-7-2-on-centos-7-rhel-7/ --do not take into account Nginx and PHP-FPM specifics especially in terms of old PHP 5.6.19 already existing.

All these instructions anyway speak of "php72", which I am afraid will change all the paths, and I'll have to update all paths to new php links everywhere.

Could you please advise how best to do this so I seamless upgrade the old PHP with the latest, with all the usual paths as above working? Otherwise we need to:

  1. Remove 5.6.19
  2. Install 7.2, and all additional modules (which will introduce the "php72" in the paths)
  3. Make sure all paths everywhere are new everywhere..

Any way to make this simpler in a OS-default way, without additional repos like "Remi" etc?

  • Where did you get PHP 5.6 from? Feb 7, 2019 at 2:59
  • Through the usual yum install php in CentOS 7. And doing yum update does not change this to a new major version like 7. It just updates it to 5.6.latest.
    – Khom Nazid
    Feb 7, 2019 at 3:09
  • 1
    It doesn't make sense. CentOS 7 came with PHP 5.4, not 5.6. So there must have been something else done to the system first, i.e. installing a third party repo for PHP. Where did it come from? Feb 7, 2019 at 3:23
  • Probably epel then. One of the usual instructions though, where the php-fpm etc are not in highly customized directories like /etc/opt/remi/php72/php-fpm.d/www.conf.
    – Khom Nazid
    Feb 7, 2019 at 3:46
  • Using "remi" repository, following the wizard instructions, a simple "yum update" shlould do it. rpms.remirepo.net/wizard (using "single version", /opt is only use for SCL, "multiple versions") Feb 7, 2019 at 6:50

1 Answer 1


Remi Collet answered in comments, so there's no answer to accept. I'm adding it here for easier visibility for anyone who needs the same help:

Steps for posterity, to save on Stack Exchange here:

  1. Remove php56w-mcrypt module with YUM before the update (it's not a much used module anyway these days)
  2. Then run the steps listed in the wizard on Remi's website
  3. Run yum update --noplugins (the dash dash noplugins options is safe)
  4. Check if any nginx conf files have old style comments starting with #. If so, replace them with the new strict comments that have to begin with ;
  5. Restart nginx (I had to manually kill any running nginx processes)

Hope this helps someone. The discussion is on Remi's forum.

Thank you.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .