简体   繁体   中英

mongodb How to install PHP Driver in lampp (Ubuntu)

I'm trying to install mongoDB on ubuntu by using the following command

sudo /opt/lampp/bin/pecl install mongo

But the next error appeared

WARNING: "pecl/mongo" is deprecated in favor of "channel:///mongodb" WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update pecl/mongo requires PHP (version >= 5.3.0, version <= 5.99.99), installed version is 7.1.6 No valid packages found install failed

then i changed the command to:

sudo /opt/lampp/bin/pecl install mongodb

but the following error

Package "mongodb" Version "1.4.4" does not have REST xml available install failed

please help me

As the error message stated, the first extension you tried to install, mongo, is deprecated. The extension you want is mongodb.

Rather than use a package manager, I would recommend installing it manually. That way you customize its options, such as SSL support, which you may need for certain authentication methods. Per the installation manual , the steps are as follows:

git clone https://github.com/mongodb/mongo-php-driver.git
cd mongo-php-driver
git submodule update --init
phpize
./configure [options]
make all
sudo make install

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