uninstall mongodb php driver and install a different version - php

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

Related

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

Laravel 5.5 minimum requirements

I am using Ubuntu 17 with php 7.1 and am trying to install Laravel 5.5 but it is telling me to check the minimum requirements.
I can't install the recommended php extensions. I am using sudo add-apt-repository ppa:ondrej/php but it appears the extension are not there and there is a mismatch from the repo
Repository 'http://ppa.launchpad.net/ondrej/php/ubuntu artful InRelease' changed its 'Label' value from '***** The main PPA for PHP (5.6, 7.0, 7.1) with many PECL extensions *****' to '***** The main PPA for supported PHP versions with many PECL extensions *****'
Your composer should say what extensions you need.
You also check doc https://laravel.com/docs/master#installation
PHP >= 7.0.0
OpenSSL PHP Extension
PDO PHP Extension
Mbstring PHP Extension
Tokenizer PHP Extension
XML PHP Extension
sudo apt-get install curl php-curl php-mcrypt php-mbstring php-gettext
Install PHP 7.1 on Ubuntu
Use the following set of commands to add PPA for PHP 7 in your Ubuntu system and install it.
> sudo apt-get install python-software-properties
> sudo add-apt-repository ppa:ondrej/php
> sudo apt-get update
> sudo apt-get install -y php7.1
Now use the following command to check installed php version on your system.
> php -v
Install PHP 7 Modules/Extensions
Find all the available PHP 7 modules using the following command:
> sudo apt-cache search php7-*
Install required PHP extensions using the following command
> sudo apt-get install <extension-name>
You can install multiple extensions using the same command. Separate extension names by a space.
For example
> sudo apt-get install php7.1-xml php7.1-xmlrpc php7.1-zip
Laravel 5.5 System Requirements Checker
To verify system requirements for Laravel 5.5 you can then use the following simple app.
https://github.com/mitesh1409/laravel-system-requirements-checker
Do git clone of this repo inside your server's root directory and then execute it.
For example using Apache server on Ubuntu 16.04, do git clone of this repo inside "var/www/html". It will create an app folder named "laravel-system-requirements-checker". Now you can run this using the url "http://localhost/laravel-system-requirements-checker/".
I hope this will help everyone starting development on Laravel 5.5.
Thanks.
Laravel-Requirement-Checker from browser
https://github.com/hosamalzagh/Laravel-Requirement-Checker

MongoDB PHP driver on Ubuntu 14.04

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)

Update PHP Mongo Extension to 1.5 on Ubuntu 14

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

Categories