3
I've installed XAMPP on my MacBook. PHP and MySQL are working fine, so I followed it up with mongo. I did the following:
- brew install mongo (success)
- brew install autoconf (success)
- sudo /Applications/XAMPP/xamppfiles/bin/pecl install mongo (success)
So far so good. I added the complete mongo.so path to the very end of `/etc/php.ini like so:
[mongo]
extension=/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20121212/mongo.so
The Problem:
Typing in php --version
, however, returns the following:
PHP Warning: PHP Startup: mongo: Unable to initialize module
Module compiled with module API=20121212
PHP compiled with module API=20100525
These options need to match in Unknown on line 0
PHP 5.4.24 (cli) (built: Jan 19 2014 21:32:15)
What I Tried:
I managed to get rid of that error above (notice: get rid), by updating OS X's PHP via the following: curl -s http://php-osx.liip.ch/install.sh | bash -s 5.5
I then added the following lines to .bash_profile: export PATH=~/bin:/usr/local/php5/bin:$PATH
php -m
now lists mongo as one of the modules, and it no longer produces the above error.
However, phpinfo() does NOT have mongo, and running my webpage using mongo client gives me the following error:
FatalErrorException Class 'MongoClient' not found
So, I repeated the following: sudo /Applications/XAMPP/xamppfiles/bin/pecl install mongo
And now it's telling me that my mongo is up to date:
pecl/mongo is already installed and is the same as the released version 1.5.5
Additional info:
- PHP version: PHP 5.5.14 (cli) (built: Jun 28 2014 10:29:43)
- Mongo version: MongoDB shell version: 2.6.3
- Mongo client: 1.5.5
I found it in
/Applications/XAMPP/xamppfiles/etc/
. That did it. Thanks! – zack_falcon – 2014-08-07T07:49:49.370thanks for the info. I did out of my head and wasn't sure about lib or etc.... I've edited the answer to show the correct path! – heiglandreas – 2014-08-07T10:34:04.817