简体   繁体   中英

How to install MongoDB Driver in XAMPP mac (OSX)

I have installed mongodb and I can access it through my terminal. I want to install drivers for XAMPP in OSX (Yosemite). I downloaded mongo.so file and kept it under /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20131226 path which is my extension_dir pointing to and wrote extension=mongo.so in php.ini file but no luck. After restarting Apache I can't find any mongodb when I run phpinfo() . Please help. Maybe I just want the correct mongo.so file. Please help.

in command line...

sudo /Applications/XAMPP/xamppfiles/bin/pecl install mongo 

if it gives ERROR: `phpize' failed

Download autoconf

curl http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz > autoconf.tar.gz

Untar the autoconf archive

tar -xvzf autoconf.tar.gz

Configure and make – note the folder un-archived may have a different name.

cd autoconf-2.69
./configure
sudo make && sudo make install

This installs autoconf to '/usr/local/bin/autoconf'. In order to get phpize to work set the PHP_AUTOCONF environment variable to point to the newly installed autoconf.

export PHP_AUTOCONF=/usr/local/bin/autoconf

write anywhere in php.ini : extension=mongo.so (not ;extension=mongo.so or ;extension=:"mongo.so" ) just write extension=mongo.so

then restart this

if you get any problem then let me know I'll for sure fix it...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM