Centos 5.7-install PHP MongoDB Extension

Source: Internet
Author: User
Tags php mongodb

To view the official documentation, run the following command:

 
Sudo PECL install Mongo

But on my machine, this method cannot be successfully executed. The following error occurs:

  PECL install uninstall downloading Mongo -1.2.10 . tgz... starting to download Mongo -1.2.10.tgz (86,463  bytes )..................... done:  86,463  bytes  36  source files, buildingrunning: phpizeconfiguring   for  : php api version:  20041225  Zend module api no:  20060613  Zend extension api no:  220060519/usr/bin/phpize:/tmp/Mongo/build/shtool: /bin/ Sh: Bad Interpreter: Permission deniedcannot find Autoconf. please check your Autoconf installation and the   $ php_autoconf   environment variable. then, rerun this script. error: 'phpize' failed  

Install the SDK by yourself as follows:

* Download the Mongo extension package:

 
Mkdir/home/Pai_phpcd/Home/Pai_phppecl download Mongo

The version I downloaded is mongo-1.2.10.tgz

* Decompress the file and enter the Mongo directory. Run the phpize command to generate the configure script:

 
Tar zxf mongo-1.2.10. Tgzcd Mongo-1.2.10
Phpize

Perform configuration and installation:

 
./Configure -- With-PHP-Config =/usr/bin/PHP-Configmakemake install

After successful installation, the path after successful installation is displayed

 
Installing shared extensions:/usr/lib/PHP/modules/

Edit/etc/PHP. ini and add Mongo. So

 
VI/etc/PHP. ini

Extension = Mongo. So

: After WQ is saved and exited, restart Apache

Run the command to check whether the execution is successful.

Php-I | grep Mongo

Or you can view it in the output of phpinfo ().

 

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.