How to install the mongodb php extension: first open the download address and download the "php-mongodb" extension; then compile and install it; finally add the mongo configuration in the "php.ini" file.
3: No need to compile, it is a compiled binary executable file.
4: Start mongod service./bin/mongod --dbpath /path/to/database --logpath /path/to/log --fork --port 27017
#Connect to server:
Mongodb php extensions
pecl.php.net
2. Download php-mongodb extension
3. Mongodb-1.1.6 download address:
http:/ /pecl.php.net/get/mongo-1.6.13.tgz 4. Compilation and installation:$ tar zxvf mongodb -mongodb-php-driver-
[root@localhost mongo-1.6.13]# ./configure --with-php-config=/usr/local/php5.6/bin/php-config
[root@localhost mongo-1.6.13]# make && make install
After successful compilation:
##/usr/local/php5.6/lib/php/extensions/no-debug-non-zts-20131226/
5
, findphp.ini
file:find / -name php.iniVim /etc/php.ini##Add a line:extension=/usr/ local/php5.6/lib/php/extensions/no-debug-non-zts-20131226/
mongo.so
Execute After the above command, you need to modify thephp.inifile and addmongo in the
php.inifileConfiguration, the configuration is as follows:##Note:You need to specify the
extension_dirpath to the configuration item.
6. Finally check whether phpinfo() is installed successfully:
For more related knowledge, please visitPHP Chinese website!
The above is the detailed content of How to install mongodb php extension. For more information, please follow other related articles on the PHP Chinese website!