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
Related
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
I need to make my Ubuntu 16.04. Is there a way using the GUI or is the simplest way to do this by using terminal?
I have already installed PHP 7.1, MariaDB.
I need to enable:
OpenSSL PHP Extension
PDO PHP Extension
Mbstring PHP Extension
Tokenizer PHP Extension
XML PHP Extension
The Laravel server requirements specify the PHP extensions, including BCMath, Ctype, cURL, DOM, Fileinfo, JSON, Mbstring, OpenSSL, PCRE, PDO, Tokenizer, and XML, are required. These extensions are usually included and enabled during a PHP installation.
You can use the following command in Ubuntu to check the necessary extensions.
sudo apt install openssl php-bcmath php-curl php-json php-mbstring php-mysql php-tokenizer php-xml php-zip
Installation specific to a particular version of PHP (such as PHP 8.2)
sudo apt install openssl php8.2-bcmath php8.2-curl php8.2-json php8.2-mbstring php8.2-mysql php8.2-tokenizer php8.2-xml php8.2-zip
Additional PHP extensions may require for your composer packages. Refer to the links below for more information.
PHP extensions for Ubuntu 22.04 LTS (Jammy Jellyfish)
PHP extensions for Ubuntu 20.04 LTS (Focal Fossa)
PHP extensions for Ubuntu 18.04 LTS (Bionic)
PHP extensions for Ubuntu 16.04 LTS (Xenial)
**
New requirements for installing Laravel 8 and PHP 8:
**
sudo apt install php8.0-common php8.0-dom php8.0-bcmath openssl php8.0-mbstring
Run the below command. It will install all required php8.1 extensions in Ubuntu
sudo apt install php8.1 php8.1-cli php8.1-common php8.1-mysql php8.1-zip php8.1-curl php8.1-gd php8.1-mbstring php8.1-xml php8.1-bcmath php8.1-fpm php8.1-phpdbg php8.1-cgi libphp8.1-embed libapache2-mod-php8.1
You can install PHP extensions like this:
sudo apt-get install php-xsl php-pgsql
Here is Extension with Name and Commands for UBUNTU
Install or enable PHP's curl extension
sudo apt install phpy-curl
Install or enable PHP's simplexml extension.
sudo apt install php-xml
Install or enable PHP's gd extension
sudo apt-get install php-gd
Install or enable PHP's zip extension
sudo apt install php-zip
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