I ran: composer require mongodb/mongodb
. But it gave me the following error :
has error:
- mongodb/mongodb 1.0.1 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your system. - mongodb/mongodb 1.0.0 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your system. - Installation request for mongodb/mongodb ^1.0 -> satisfiable by mongodb/mongodb[1.0.0, 1.0.1].
I tried : composer show -p
Then it gave me:
......
ext-iconv 0 The iconv PHP extension
ext-mcrypt 0 The mcrypt PHP extension
ext-mhash 0 The mhash PHP extension
ext-mongo 1.6.12 The mongo PHP extension
ext-mysql 1.0 The mysql PHP extension
ext-mysqli 0.1 The mysqli PHP extension
......
Why am I getting the error?
php -m
.....
libxml
mbstring
mcrypt
mhash
mongo
mysql
mysqli
openssl
pcntl
pcre
PDO
.....
I'm using ubuntu 14.04 LTS
MongoDB installs as a systemd service, which means that you can manage it using standard systemd commands alongside all other sytem services in Ubuntu. To verify the status of the service, type: sudo systemctl status mongodb.
$ sudo pecl install mongodb
$ sudo nano /etc/php/*version*/mods-available/mongodb.ini
and write inside: extension=mongodb.so
$ sudo ln -sv /etc/php/*version*/mods-available/mongodb.ini /etc/php/*version*/apache2/conf.d/20-mongodb.ini
$ sudo ln -sv /etc/php/*version*/mods-available/mongodb.ini /etc/php/*version*/cli/conf.d/20-mongodb.ini
$ sudo service apache2 restart
It may be necessary to reinstall jenssegers/mongodb: $ composer require jenssegers/mongodb
for quick and easy, just do:
sudo pecl install mongodb
sudo nano /etc/php5/apache2/php.ini
, add (at bottom or wherever):; mongodb
extension=mongodb.so
sudo nano /etc/php5/cli/php.ini
, add (at bottom or wherever):; mongodb
extension=mongodb.so
sudo service apache2 restart
i'm run:
sudo apt-get install libpcre3-dev
then:
pecl install mongodb
and add: extension=mongodb.so
to bottom line of cli/php.ini
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With