Install PHP Mongo extension on CentOS

MongoDB client on CentOS / RedHat

The Mongo client can be installed through yum, simply add the MongoDB repository as described in the official manual.

I already explained this on other Linux distributions, here we go for CentOS and RedHat (maybe Slackware, too).


PHP Mongo extension


To install the Mongo extension for PHP, basically you’d do it via pecl:


Or you can do it manually, which is essentially the same as what pecl and pear do!


Both, the database server+client and the PHP extension are required to be able to run queries against the MongoDB.

The code is updated quite often so it’s worth having a look from time to time.
I prefer using fresh code instead of LTS versions or packages built ages ago.

Leave a Reply

Your email address will not be published. Required fields are marked *