Topic: installing mongodb driver on php 7.1.3

I installed mongodb with  yum install -y mongodb-org

yum --enablerepo=remi,remi-php71 install php-pecl-mongo
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
* base: mirror.atlanticmetro.net
* epel: fedora-epel.mirrors.tds.net
* extras: mirror.atlanticmetro.net
* remi: repo1.ash.innoscale.net
* remi-php70: repo1.ash.innoscale.net
* remi-php71: repo1.ash.innoscale.net
* remi-safe: repo1.ash.innoscale.net
* updates: mirror.atlanticmetro.net
Resolving Dependencies
--> Running transaction check
---> Package php-pecl-mongo.x86_64 0:1.6.14-1.el7.remi.5.4 will be installed
--> Processing Dependency: php(zend-abi) = 20100525-64 for package: php-pecl-mongo-1.6.14-1.el7.remi.5.4.x86_64
--> Processing Dependency: php(api) = 20100412-64 for package: php-pecl-mongo-1.6.14-1.el7.remi.5.4.x86_64
--> Finished Dependency Resolution
Error: Package: php-pecl-mongo-1.6.14-1.el7.remi.5.4.x86_64 (remi)
           Requires: php(zend-abi) = 20100525-64
           Installed: php-common-7.1.3-1.el7.remi.x86_64 (@remi-php71)
               php(zend-abi) = 20160303-64
           Available: php-common-5.4.16-42.el7.x86_64 (base)
               php(zend-abi) = 20100525-64
           Available: php-common-5.4.45-13.el7.remi.x86_64 (remi)
               php(zend-abi) = 20100525-64
           Available: php-common-7.0.16-1.el7.remi.x86_64 (remi-php70)
               php(zend-abi) = 20151012-64
           Available: php-common-7.0.17-1.el7.remi.x86_64 (remi-php70)
               php(zend-abi) = 20151012-64
           Available: php-common-7.1.2-1.el7.remi.x86_64 (remi-php71)
               php(zend-abi) = 20160303-64
Error: Package: php-pecl-mongo-1.6.14-1.el7.remi.5.4.x86_64 (remi)
           Requires: php(api) = 20100412-64
           Installed: php-common-7.1.3-1.el7.remi.x86_64 (@remi-php71)
               php(api) = 20160303-64
           Available: php-common-5.4.16-42.el7.x86_64 (base)
               php(api) = 20100412-64
           Available: php-common-5.4.45-13.el7.remi.x86_64 (remi)
               php(api) = 20100412-64
           Available: php-common-7.0.16-1.el7.remi.x86_64 (remi-php70)
               php(api) = 20151012-64
           Available: php-common-7.0.17-1.el7.remi.x86_64 (remi-php70)
               php(api) = 20151012-64
           Available: php-common-7.1.2-1.el7.remi.x86_64 (remi-php71)
               php(api) = 20160303-64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

What am i doing wrong here

Re: installing mongodb driver on php 7.1.3

See compatibility list
https://blog.remirepo.net/pages/PECL-ex … RPM-status

The "mongo" extension is NOT compatible with PHP 7.x

The new extension "mongodb" is designed for PHP 5.x and 7.x, but API is different.

The php-alcaeus-mongo-php-adapter package (alcaeus/mongo-php-adapter) provides a compatibility layer -pure PHP)

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: installing mongodb driver on php 7.1.3

I am very eager to start working with PHP 7 however one issue is getting in the way... I primarily use MongoDB for the database, and the problem is that I don't know how to install the MongoDB driver/client for PHP 7.

My current installation is PHP 5.6 and on my Mac and brew install php56-mongo does the trick.

Can anyone recommend how I can get this working on my Mac or an Ubuntu install?

Thanks in advance and much appreciated!

Re: installing mongodb driver on php 7.1.3

Follow https://rpms.remirepo.net/wizard/
Then You need the php-pecl-mongodb package.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi