I am trying to install mongodb driver for php 7.1 but not found any solution.
Used following command
pecl install mongodb
But gives , pecl command not found. Tried to install pecl by
yum install pecl
But given no package available
Try install php-pear package. pecl is included on it.
P.S. See https://pkgs.org/download/php-pear
You can also use yum packages:
yum install php71-php-pecl-mongodb.x86_64 -y
Related
I am using Ubuntu 17.04 64 bit
I am trying to install mongodb driver for php7.0
There is no driver for this version.
How can I install it?
Why not, there is driver for it, to install use
sudo apt-get install php-mongodb
do not sepcify any version on the php, like php7. just php-mongodb
You can do a manual install via the pecl extension using
$ sudo pecl install mongodb
for further info, check out this link
My current version of pecl SSH2 is 0.12 and I am trying to upgrade it to 0.13.
I tried both:
pecl upgrade ssh2-0.13
and
pecl install ssh2-0.13
and got
ERROR: pecl.php.net/ssh2 not installed
Not much feedback, what else can I try?
using php 5.6 and PEAR 1.9.5
I am using CentOS and following helped me to upgrade, might help you too
yum install gcc php-devel php-pear libssh2 libssh2-devel
// or in ubuntu(deb) sudo apt-get install ...............
pecl install -f ssh2
Actually i removed my old version and did above. And i installed all the packages that require. Please make sure you have installed all the required packages (gcc, php-devel, php-pear, libssh2, libssh2-devel) and then try to install or upgrade again.
I have installed MongoDB PHP driver on Ubuntu 14.04 using this command
sudo apt-get install php5-mongo
and it installed the driver but an older version which is 1.4, the problem is I need latest one, which is 1.6. I already tried this command.
sudo apt-get install php5-mongodb
but getting error no package found. Can someone help installing latest mongodb php driver on ubuntu 14.04
I followed this link as well and installed pecl extension but nothing worked http://zacvineyard.com/blog/2013/02/the-easy-way-to-install-the-mongodb-php-driver-on-ubuntu-1204
Thanks.
Try using:
sudo apt-get install php5-dev php5-cli php-pear -y
sudo pecl install mongo
As shown here: http://blog.programster.org/debian-8-install-mongodb-php-driver/ (I've tested on ubuntu 14 and it worked)
PHP and Mongo are working correctly however the php5-mongo extension needs updating.
Currently it is version 1.4.5, version 1.5.x is required to be compatible with the latest https://github.com/doctrine/mongodb/
Running does not update the version.
sudo apt-get install php5-mongo
Additional info
mongod --version db version v2.6.12
php --version PHP 5.5.9-1ubuntu4.14
How can the extension be updated? Is pecl required to perform the update?
Try with PECL
sudo pecl install mongodb
Sometime you may get SSL error when connecting to the mongodb so please install dependencies before the pecl installation
sudo pecl channel-update pecl.php.net
sudo pecl uninstall mongodb
sudo apt-get install libcurl4-openssl-dev pkg-config libssl-dev
sudo pecl install mongodb
You should add "extension=mongodb.so" to php.ini
Verify the MongoDB extension and module by using
sudo php --ri mongodb | grep version
sudo apt-cache policy php-mongodb
I'm using Ubuntu Xampp (Lampp) and currently on MongoDB 1.5.3 driver.
I need to downgrade to 1.4.5, but when re-installed the downgraded driver, it does not change in phpinfo(). Yes, I have restarted Apache.
So, how do I uninstall the current one and install the downgraded version?
Update: 2018-06-20:
PECL package mongo is now deprecated, you should use mongodb package instead:
sudo pecl install -f mongodb-1.4.4
Original answer
You can upgrade to a specific version of a driver by using pecl:
sudo pecl install -f mongo-1.4.5
If you get a pecl: command not found error you will need to install PEAR package:
sudo apt-get update && sudo apt-get install php-pear
You can use this command to check that you have the correct version installed:
sudo pecl info mongo
Or you can check php configuration directly with:
php -i | grep -A 1 MongoDB