MongoDB PHP driver on Ubuntu 14.04 - php

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)

Related

Unable to install php 5.6 in ubuntu 14.04

I am trying to install php5.6 into my ubuntu 14.04 server.
Using following link
https://tecadmin.net/install-php5-on-ubuntu/
Using following Commands.
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php5.6
but getting following error.
"Unable to locate package php5.6"
"Couldn't find ant package by regex'php5.6' "
Please provide solution.
It was removed from repository. You can`t install it from ondrej/php repository
Ubuntu 14.04 (Trusty), PHP 5.6 and PHP 7.0 going away See also: Ubuntu 14.04 LTS reached end-of-life

Install mongodb driver for php 7.1 on RHEL 7.1

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

Install php7.0 mongodb on ubuntu 17.04

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

GD2 extension on PHP 5.6.14 OS Ubuntu 14.04 LTS

I have installed Ubuntu 14.04 LTS and LAMP server. By default the installed version of php had been 5.5, so I had to upgrade to 5.6 according to the manuals on the web .
After the upgrade the GD extension is not working well.
I tried:
sudo apt-get remove -purge php5-gd - to remove and purge the installed extension.
sudo apt-get install php5-gd - to install again.
Then I test the installation and this is the output:
sudo apt-get install php5-gd
Reading package lists... Done
Building dependency tree
Reading state information... Done
php5-gd is already the newest version.
Unfortunately I don't see the GD extension in phpinfo page and the test script from the application which I am trying to run also gives me error about GD2.
I have tried almost every suggestion that I found in Google, but find no joy. You are my last hope now. Thank you.

uninstall mongodb php driver and install a different version

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

Categories