This time for everyone to bring PHP-MONGODB expansion of the use of methods, the use of php-mongodb extension of the attention of 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:
Implementation of PHP One-way hash encryption function
Php+mysql Timing Data Statistic optimization
thinkphp Implementation Payment (JSAPI payment) process Tutorial _php instance