I followed a lot through google. Evryone having their own prospectives. Here I am posting you the steps to install mongodb-php extension manually which is the best way to install mongodb extension for php in mac.
I have done this in mac high sierra.
$ git clone https://github.com/mongodb/mongo-php-driver.git$ cd mongo-php-driver$ git submodule update --init$ phpize$ ./configure$ make all$ sudo make install
you can find the .so file in
Open your php.ini file and add the following line to it:
$ extension=<directory-url-to mongodb.so>/mongo-php-driver/modules/mongodb.so
This will solve the issue of your mongodb php extension issue in mac high sierra.
Thanks for your time. Please visit again.