Installing the MongoDB PHP Driver with PECL

Информация по установке этого расширения PECL может быть найдена в главе руководства Установка PECL расширений. Дополнительная информация, такая как новые версии, скачивание, исходные файлы, информация о разработчике и CHANGELOG, может быть найдена здесь: » http://pecl.php.net/package/mongodb

Linux, Unix, and OS X users may run the following command to install the driver:

$ sudo pecl install mongodb

Add the following line to your php.ini file:

extension=mongodb.so

Коментарии

Автор:
[Editor's note: fixed typo]

There are some additional requirements you need to build the pecl package.

sudo apt-get install libcurl4-openssl-dev pkg-config libssl-dev libsslcommon2-dev
2016-06-19 01:57:45
http://php5.kiev.ua/manual/ru/mongodb.installation.pecl.html
An additional requirement might be pkg-config (on Ubuntu 14.04).

$ pecl install mongodb
...
configure: error: Cannot find OpenSSL's libraries
ERROR: `/tmp/pear/temp/mongodb/configure --with-php-config=/usr/bin/php-config' failed

But:

$ apt-get install pkg-config
...
Setting up pkg-config (0.26-1ubuntu4) ...
$ pecl install mongodb
...
Build process completed successfully
Installing '/usr/lib/php/20151012/mongodb.so'
install ok: channel://pecl.php.net/mongodb-1.1.7
configuration option "php_ini" is not set to php.ini location
You should add "extension=mongodb.so" to php.ini
2016-06-30 14:28:14
http://php5.kiev.ua/manual/ru/mongodb.installation.pecl.html
Автор:
I got an error "fatal error: pcre.h: No such file or directory" and had to also had to install another dependency

sudo apt-get install libpcre3-dev
2016-09-24 09:17:22
http://php5.kiev.ua/manual/ru/mongodb.installation.pecl.html
Ubuntu 16.04

sudo apt-get install libcurl4-openssl-dev pkg-config libssl-dev libsslcommon2-dev

sudo pecl install mongodb

add extension=mongodb.so in fpm and cli:

sudo vim /etc/php/7.0/fpm/conf.d/30-mongodb.ini

sudo vim /etc/php/7.0/cli/conf.d/30-mongodb.ini

Restart service:

sudo systemctl restart php7.0-fpm

sudo systemctl reload nginx
2016-11-08 15:16:14
http://php5.kiev.ua/manual/ru/mongodb.installation.pecl.html
after installed and added extension=mongodb to php.ini, when i run php -v i get this error: 

bus error php -v

what could it be? the build process completed successfully.
2017-02-14 01:11:33
http://php5.kiev.ua/manual/ru/mongodb.installation.pecl.html
Hi,
I am looking into installation of php mongo db driver.
I have checked with phpinfo it shows mongodb module have been loaded but when I use in my code it give error "Fatal error: Uncaught Error: Class 'MongoDB' not found "

i have another module for redis and it works perfectly . Initially I was getting same error but phpinfo was showing module is not loaded .

I guess there is some problem with driver. I have tried all the documents and website links which mention to include extenstion=mongodb.so which i have already done.

I am using open suse 42.2 leap with apache server.

Could you please investigate this issue.
If you need more info please let me know.

Thanks
Maneeshg
2017-02-21 01:20:48
http://php5.kiev.ua/manual/ru/mongodb.installation.pecl.html
Автор:
The following steps worked for me on Centos7

sudo yum install -y openssl-devel
sudo yum install pecl
sudo yum install gcc
sudo pecl install mongodb
2017-07-12 23:28:24
http://php5.kiev.ua/manual/ru/mongodb.installation.pecl.html
On Ubuntu you can just do:

  sudo apt-get install php-mongodb

or the same for specific PHP version:

  sudo apt-get install php5.6-mongo

or

  sudo apt-get install php7.0-mongodb
2017-07-27 11:48:18
http://php5.kiev.ua/manual/ru/mongodb.installation.pecl.html
As of Ubuntu 20.04, php-mongodb in the database is outdated and you'll need the PECL method to install latest version of MongoDB.

To do this in Ubuntu, you'll need the php-pear plugin and php-dev:
sudo apt install php-dev php-pear

then you can run:
sudo pecl install mongodb
2020-05-19 13:30:03
http://php5.kiev.ua/manual/ru/mongodb.installation.pecl.html

    Поддержать сайт на родительском проекте КГБ