0
votes

I'm trying to update from PHP 5.6 to PHP 7 on my Vagrant machine. I'm more or less following this guide https://blog.remirepo.net/post/2017/12/04/Install-PHP-7.2-on-CentOS-RHEL-or-Fedora

I've done the following:

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm

I follow the regular steps for activating the packages, but then when I try to update through

yum update

I get the following error:

php-pecl-mongo-1.6.16-1.el7.remi.5.6.x86_64 (@remi-php56)  
Requires: php(api) = 20131106-64   
Removing: php-common-5.6.36-1.el7.remi.x86_64 (@remi-php56)

The error is actually longer. But in short, it indicates that the I need the Mongo Driver for PHP 7.

How can I update this though? I'm at loss!

1

1 Answers

1
votes
  • The mongo extension is only for PHP 5.
  • The mongodb extension is for PHP 5.5+ and PHP 7+

So yum blocks the transaction (expected) as one of the installed extension is not compatible with PHP 7.

You have to remove this extension before the upgrade.

Be aware than mongodb and mongo are really different extensions, with very different API.

Usually people use the mongodb/mongodb library to have a high level API

You can also consider using alcaeus/mongo-php-adapter library which provides the old mongo API using mongodb extension.