This time to everyone to bring pecl way to install php-mongodb extension steps in detail, pecl way to install PHP-MONGODB expansion of the attention to what, the following is the actual case, together to see.
Start installation
New virtual machine Ubuntu14.04, apache2 and php5 are installed manually;
Then we use a command to install the PHP extension
sudo pecl install MongoDB
This will be an error, showing the lack of dependent package php-pear, then install, the command is as follows
sudo apt-get install Php-pear
When we execute pecl install MongoDB command again, we will prompt phpize not internal command, need to install Php5-dev, then install the following command:
sudo apt-get install Php7.0-dev
When we execute pecl install MongoDB again, this error should be reported and the OpenSSL Library is missing. Then we need to install the following things
Apt-get install OpenSSL Libssl-dev libssl0.9.8 Libgtk2.0-dev
When the Pecl install MongoDB is executed again, the effort is finally successful, but the last hint is that we need to add the MongoDB extension manually in the php.ini file.
Finally we open, Vim/etc/php5/apache2/php.ini, add a line of such code.
#/etc/php5/apache2/php.iniextension=mongodb.so
In the end, this will show the effect.
Redis Similarly, pecl install Redis
Believe that you have read the case of this article you have mastered the method, more exciting please pay attention to the PHP Chinese network other related articles!
Recommended reading:
Php+rsa generate key bits in 1024-bit steps
PHP Development API Interface Security verification steps detailed