Installing Php/mongodb extension is a and steps task on OSX:
- Install the autoconf tool required for compiling the extension
- Install the Mongo extension
You have a to install autoconf on order to avoid the following error:
Cannot find autoconf. Please check your autoconf installation and the $PHP _autoconf environment variable. Then, rerun the this script. ERROR: ' Phpize ' failed
Enough talk, hands in work ...
Step 1. Install the Autoconf tool
Download the latest source version:
Cdmkdir AUTOCONFCD autoconfcurl http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz > autoconf.tar.gz
Untar it
Tar-xvzf autoconf.tar.gz
Configure and make
CD Autoconf-2.69./configuremakesudo make Installexport php_autoconf=/usr/local/bin/autoconf
autoconf is installed on/usr/local/bin/autoconf by default.
Step 2. Install the Mongo extension
Download the driver from the official repository:
Cdmkdir MONGO-PHP-DRIVERCD Mongo-php-drivercurl Https://codeload.github.com/mongodb/mongo-php-driver/zip/master > Mongo-php-driver-master.zip
Unzip it
Unzip MONGO-PHP-DRIVER-MASTER.ZIPCD Mongo-php-driver-master
Configure and Build
Phpize./configuremake Allsudo make Install
Check the extension was successfully created:
ls/usr/lib/php/extensions/no-debug-non-zts-20090626/
You should see the mongo.so extension file in there.
Make sure the previous directory are the same as the PHP extension directory by running:
Php-i | grep extension_dir extension_dir =/usr/lib/php/extensions/no-debug-non-zts-20090626 = /usr/lib/ php/extensions/no-debug-non-zts-20090626
If it ' s not, change the extension_dir in php.ini or move mongo.so. (See below if you don ' t have a php.ini file)
To load the extension in PHP startup, add the following line to your php.ini file:
Extension=mongo.so
If you don't have a php.ini file that has a to copy it from your Php.ini.default file like this:
sudo cp/private/etc/php.ini.default/private/etc/php.inisudo Nano/private/etc/php.ini
Add the previous "extension" line to your file, save it and restart Apache
sudo apachectl restart
from:http://andres.jaimes.net/857/setup-php-mongo-on-mac/
Installing the Php/mongodb extension on Mac OSX 10.8