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 ().