sokil/php-mongo

install problem

xinshengsiyu opened this issue · 2 comments

Hi, when I install this ext by composer, the problems occurred

  • Installation request for sokil/php-mongo ^1.22 -> satisfiable by sokil/php-mongo[1.22].
  • sokil/php-mongo 1.22 requires ext-mongo >=0.9.0 -> the requested PHP extension mongo is missing from your system.

the php info as below

php -i | grep mongo
/usr/local/etc/php/5.6/conf.d/ext-mongodb.ini,
mongodb
libmongoc bundled version => 1.5.5
libmongoc SSL => enabled
libmongoc SSL library => OpenSSL
libmongoc crypto => enabled
libmongoc crypto library => libcrypto
libmongoc crypto system profile => disabled
libmongoc SASL => enabled
mongodb.debug => no value => no value
sokil commented

MongoDb has two extensions to work with php.

  1. ext-mongo works only in php < 7.0
  2. ext-mongodb works in all versions

This library works directly with old ext-mongo extension, so it checks existance of extension in composer. With new extension library works through adapter https://github.com/alcaeus/mongo-php-adapter

So to install this library through adapter you need to skip platform requirements.

composer require "alcaeus/mongo-php-adapter"
composer require "sokil/php-mongo" --ignore-platform-reqs