試了很多方法,最後仍是這個最有效。php
[轉自:http://thatsimplecode.com/install-mongodb-driver-for-php-on-xampp-for-mac-osx]mongodb
You need to have the following installed in your Mac:code
Type the following in your terminal :ip
brew install wget
brew install autoconf
sudo /Applications/XAMPP/xamppfiles/bin/pecl install mongo
Add extension=mongo.so
to your php.ini file which can be found at /Applications/XAMPP/xamppfiles/etc
by default.terminal
Restart Apache.get
A..nd you are done.io
Tip: To install MongoDB, you can use brew install mongodb