Techies Adsense

Thursday, 18 August 2016

The MongoDB PECL extension has not been installed or enabled Ubuntu 16

I was facing issue with a website "The MongoDB PECL extension has not been installed or enabled Ubuntu 16" To solve this i have performed Below steps:

Error: The MongoDB PECL extension has not been installed or enabled"



Solutions: 

Mongo is the old driver which is not compatible with PHP 7. You have to use latest driver of mongodb

# pecl install mongodb.
....
Build process completed successfully
Installing '/usr/lib/php/20151012/mongodb.so'
install ok: channel://pecl.php.net/mongodb-1.1.8
configuration option "php_ini" is not set to php.ini location
You should add "extension=mongodb.so" to php.ini

# pear config-set php_ini /etc/php/5.6/apache2/php.ini
config-set succeeded

2nd Time I face the issue again and I perform the commands Please see history here:

sudo apt-get install php-pear php5.6-dev
sudo service apache2 restart
sudo pecl install mongo
sudo pecl install mongodb
sudo touch /etc/php/5.6/mongo.ini
$vi /etc/php/5.6/mongodb.ini
sudo apt-get install php5-mongo
sudo apt-get install php5.6-mongo
sudo apt-get install php5.6-mongodbd
sudo apt-get install php5.6-mongodb
sudo service apache2 restart

Now the Error has been changed it looks resolved for me :

An Error Was Encountered
Unable to connect to Database: Failed to connect to: localhost:27017: Connection refused



Thanks for visiting on This page still getting issue you can contact me.





No comments: