Installing the PHP/MongoDB extension on Mac OSX 10.8
Installing PHP/MongoDB extension is a two steps task on OSX:
- Install the autoconf tool required for compiling the extension
- Install the Mongo extension
You have to install autoconf in order to avoid the following error:
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script. ERROR: `phpize’ failed
Enough talk, hands on work…
Step 1. Install the autoconf tool
Download the latest source version:
cd
mkdir autoconf
cd autoconf
curl 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
./configure
make
sudo make install
export 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:
cd
mkdir mongo-php-driver
cd mongo-php-driver
curl https://codeload.github.com/mongodb/mongo-php-driver/zip/master > mongo-php-driver-master.zip
Unzip it
unzip mongo-php-driver-master.zip
cd mongo-php-driver-master
Configure and build
phpize
./configure
make all
sudo make install
Check that 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 is 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 on PHP startup, add the following line to your php.ini file:
extension=mongo.so
If you don’t have a php.ini file you have to copy it from your php.ini.default file like this:
sudo cp /private/etc/php.ini.default /private/etc/php.ini
sudo 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的更多相关文章
- XE6移动开发环境搭建之IOS篇(8):在Mac OSX 10.8中安装XE6的PAServer(有图有真相)
网上能找到的关于Delphi XE系列的移动开发环境的相关文章甚少,本文尽量以详细的图文内容.傻瓜式的表达来告诉你想要的答案. 原创作品,请尊重作者劳动成果,转载请注明出处!!! 安装PAServer ...
- XE6移动开发环境搭建之IOS篇(7):在Mac OSX 10.8中安装Xcode4.6.3(有图有真相)
网上能找到的关于Delphi XE系列的移动开发环境的相关文章甚少,本文尽量以详细的图文内容.傻瓜式的表达来告诉你想要的答案. 原创作品,请尊重作者劳动成果,转载请注明出处!!! 在安装Xcode前, ...
- XE6移动开发环境搭建之IOS篇(4):VMware9里安装Mac OSX 10.8(有图有真相)
网上能找到的关于Delphi XE系列的移动开发环境的相关文章甚少,本文尽量以详细的图文内容.傻瓜式的表达来告诉你想要的答案. 原创作品,请尊重作者劳动成果,转载请注明出处!!! 以下内容比较长,我们 ...
- 虚拟机VMware 9安装苹果MAC OSX 10.8图文教程
前些天虚拟机VMware Workstation 9出来,相信大家都已经熟悉VM9了,至于MAC OSX 10.8系统,那也是出来一段时间了,本篇文章就是来讲解VMware Workstation 9 ...
- 深度学习框架-caffe安装-环境[Mac OSX 10.12]
深度学习框架-caffe安装 [Mac OSX 10.12] [参考资源] 1.英文原文:(使用GPU) [http://hoondy.com/2015/04/03/how-to-install-ca ...
- 深度学习框架-caffe安装-Mac OSX 10.12
p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px ".PingFang SC"; color: #454545 } p.p2 ...
- XE6移动开发环境搭建之IOS篇(7):在Mac OSX 10.8中安装XE6的PAServer(有图有真相)
XE6移动开发环境搭建之IOS篇(7):在Mac OSX 10.8中安装XE6的PAServer(有图有真相) 2014-08-22 21:06 网上能找到的关于Delphi XE系列的移动开发环境的 ...
- Install mcrypt for php on Mac OSX 10.10 Yosemite for a Development Server
mcrypt is a file encryption method using secure techniques to exchange data. It is required for some ...
- Setup Tensorflow with GPU on Mac OSX 10.11
Setup Tensorflow with GPU on OSX 10.11 环境描述 电脑:MacBook Pro 15.6 CPU: 2.7GHz 显卡: GT 650m 系统:OSX 10.11 ...
随机推荐
- CF192div2-330B - Road Construction
题意:给定n个城市并建造马路是的两两到达,且距离不能超过2 因为0<=m<n/2,所以必然存在某个城市是无限制的,那就可以以这个无限制的城市为中心建造.... 只要想通了真尼玛简单.... ...
- POJ2201+RMQ
/* RMQ */ #include<stdio.h> #include<string.h> #include<stdlib.h> #include<algo ...
- cocos2d-x mac or windows eclipse android ------ Eclipse工程里面还会有许多警告
由于公司的游戏项目比较特殊, coco2d-x 的 ios 和 android 的游戏 代码 没有采用 共享目录的开发方式.所以android 内的 c++ 游戏代码全部放在 jni 下, ...
- ANDROID_MARS学习笔记_S01原始版_003_对话框
1.AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest ...
- Native Application 开发详解(直接在程序中调用 ntdll.dll 中的 Native API,有内存小、速度快、安全、API丰富等8大优点)
文章目录: 1. 引子: 2. Native Application Demo 展示: 3. Native Application 简介: 4. Native Ap ...
- ActionBar官方教程(7)自定义操作项的view,如何得到它及处理它的事件
Adding an Action View An action view is a widget that appears in the action bar as a substitute for ...
- 【PythonChallenge】Level 3
题目为正则表达式,需要注意EXACTLY的含义,即AAAAxBBB中x不满足条件,但aAAAxBBBa却满足条件.使用perl解决此题,利用s///替换字母,循环读取整个源码文件,结果为linkedl ...
- Covariance and Contravariance in C#, Part Two: Array Covariance
http://blogs.msdn.com/b/ericlippert/archive/2007/10/17/covariance-and-contravariance-in-c-part-two-a ...
- shutdown,init,halt,poweroff,reboot的区别和联系, pkill -kill -t tty7注销
前言 最近这些天,每天晚上关机前,都会在osc上发一条动弹,“我要init 0了,各位晚安啊”,这是一件再正常不过的事情了. 看似很平常的一件事情,不过在昨晚就被一位同学的回复给难住了,到底是什么样的 ...
- C# #if DEBUG
首先,大小写不能写错,其次,解决方案配置设为:Debug,才会执行该语句,如果在条件里面搭配Debug.Assert等,效果甚佳.而如果要设置为Release模式,就不会执行条件语句中的内容,有时候可 ...