简体   繁体   中英

mongo php library installation error

I have mongodb version 3.2.3 and php mongo driver version 1.6.12. and I am trying to install mongo-php library using composer.

$ composer require "mongodb/mongodb=^1.0.0"

and got this error:

Your version of PHP, 5.4.16, is affected by CVE-2013-6420 and cannot safely perform certificate validation, we strongly suggest you upgrade.
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1

 - mongodb/mongodb 1.0.1 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your system. - mongodb/mongodb 1.0.0 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your system. 
- Installation request for mongodb/mongodb ^1.0.0 -> satisfiable by mongodb/mongodb[1.0.0, 1.0.1].

  To enable extensions, verify that they are enabled in those .ini files:

- /etc/php.ini
- /etc/php.d/curl.ini
- /etc/php.d/dom.ini
- /etc/php.d/fileinfo.ini
- /etc/php.d/json.ini
- /etc/php.d/mbstring.ini
- /etc/php.d/mysql.ini
- /etc/php.d/mysqli.ini
- /etc/php.d/pdo.ini
- /etc/php.d/pdo_mysql.ini
- /etc/php.d/pdo_sqlite.ini
- /etc/php.d/phar.ini
- /etc/php.d/posix.ini
- /etc/php.d/sqlite3.ini
- /etc/php.d/sysvmsg.ini
- /etc/php.d/sysvsem.ini
- /etc/php.d/sysvshm.ini
- /etc/php.d/wddx.ini
- /etc/php.d/xmlreader.ini
- /etc/php.d/xmlwriter.ini
- /etc/php.d/xsl.ini
- /etc/php.d/zip.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

  Installation failed, deleting ./composer.json.

Need Help to resolve this. Am I using installing wrong version of library?Can anyone please share the links or commands from where I can install mongo php library.

Your version of PHP, 5.4.16, is affected by CVE-2013-6420

You need to update your php version. Go to php 7!

for below php 5.6 plz try this :

$ pecl install mongodb

$ echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`

or download mongodb.so file as per your php version and paste that in php/ext folder.

for more info about mongo lib and driver compatibiltiy use the below link

https://docs.mongodb.com/ecosystem/drivers/php/

$pecl install mongodb . In php.ini you add extension=mongodb.so . If you get error: sasl.h notfound , you need to install cyrus-sasl-devel, if error in php-pear, because of version php 5.6 you should uninstall php-pear and install php56w-pear.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM