Install PHP's MongoDB drive shorthand

Source: Internet
Author: User
Tags install php

Installation Environment: Centos 6.5

PHP 5.3.27

Here PHP is installed, the installation path is:

/usr/local/php/

To download the installation file:

Http://pan.baidu.com/s/1sjjTmbz

Get file: mongo-php-driver.tar.gz

Unpack the files and go to the installation folder:

tar -zxf mongo-php-driver. Tar . Gzcd. /mongo-php-driver

Compile and install the extension:

/usr/local/php/bin/phpize. /configure--with-php-config=/usr/local/php/bin/php-configmakeinstall

To modify the PHP configuration file php.ini, add the extension settings:

Extension=mongo.so

Note: you need to indicate the path to the Extension_dir configuration item.

Verify that you have successfully installed the MONGO extension:

grep MONGO

If you see the following:

Mongo

Indicates that the installation is successful.

PHP Create connection:

$mongoCon = new Array (' connect ' = =true, ' persist ' =true));

The MongoDB database can be manipulated with $mongoCon .

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.