Browsing all articles in MongoDB

Saat install mongo extension untuk php di vps bersistem operasi Centos, muncul error sebagai berikut.

[~]# pecl install mongo
downloading mongo-1.1.4.tgz ...
Starting to download mongo-1.1.4.tgz (68,924 bytes)
.................done: 68,924 bytes
18 source files, building
running: phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
building in /var/tmp/pear-build-root/mongo-1.1.4
running: /root/tmp/pear/mongo/configure
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
ERROR: `/root/tmp/pear/mongo/configure' failed

Duh kenapa nih, pas install di laptop bersistem operasi Ubuntu 10.04 kagak pernah ada masalah, di Centos kok bermasalah gini ya. Setelah gogling sana gogling sini, akhirnya diputuskan untuk install manual, caranya sebagai berikut.

[~]# wget http://pecl.php.net/get/mongo-1.1.4.tgz
[~]# tar -zxf mongo-1.1.4.tgz
[~]# cd mongo-1.1.4
[~]# phpize
[~]# ./configure
[~]# make
[~]# make install

Kemudian tambahkan extension=mongo.so ke file php.ini, restart apache dan ekstensi mongo sudah terinstall dan siap digunakan :D