Skip to content

Instantly share code, notes, and snippets.

@parsingphase
Created November 10, 2015 11:17
Show Gist options
  • Save parsingphase/5dde0895bb8114a76b53 to your computer and use it in GitHub Desktop.
Save parsingphase/5dde0895bb8114a76b53 to your computer and use it in GitHub Desktop.
Install mongo pecl extension on OSX. Pointer rather than step-by-step
Help from:
http://toodlepip.co.uk/2014/installing-mongo-mongo-php-mac-osx-mavericks-mamp/
https://jellystyle.com/2012/12/installing-php-extensions-with-mamp
Install MAMP: https://www.mamp.info/en/downloads/
export PATH=/Applications/MAMP/bin/php/php5.6.10/bin:$PATH
PHP src from http://php.net/downloads.php - get same version as MAMP uses!
richardg@rgmac:/Applications/MAMP/bin/php/php5.6.10/include $ ls -l
total 8
lrwxr-xr-x 1 richardg admin 22 10 Nov 10:34 php -> php-sources/php-5.6.10
drwxr-xr-x 3 richardg admin 102 10 Nov 10:34 php-sources
http://www.gnu.org/software/libiconv/
richardg@rgmac:~/builds/libiconv-1.14 $ ./configure --prefix=/Applications/MAMP/Library
make
sudo make install
richardg@rgmac:/Applications/MAMP/bin/php/php5.6.10/include/php $ ./configure --with-iconv=/Applications/MAMP/Library
https://gist.github.com/jellybeansoup/4192307 - mostly works! Enough to get tools.
richardg@rgmac:~ $ sudo pecl install mongo
...
You should add "extension=mongo.so" to php.ini
richardg@rgmac:/Applications/MAMP $ vim /Applications/MAMP/bin/php/php5.6.10/conf/php.ini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment