After googling for about an hour can\'t find any solution that works for me. I\'m on OS X 10.9 Mavericks.
Here is what the terminal says:
$ sudo pecl
This worked for me:
$ brew tap homebrew/php $ brew install php56-mongodb
Then add this to your php.ini
extension='/usr/local/opt/php56-mongodb/mongodb.so'
Notice that I am installing "php56-mongodb" and also linking to the same on php.ini. You can change that to your preferred php version.