带有MAMP的Mongo PHP驱动程序1.2.10 [英] Mongo PHP Driver 1.2.10 with MAMP
问题描述
我正在尝试获取最新的Mongo驱动程序以在OS X 10.5.8上与MAMP 1.9.6一起使用.
I'm trying to get the latest Mongo Driver to work with MAMP 1.9.6 on OS X 10.5.8.
由于似乎没有预编译的发行版,因此我从源代码成功构建了该发行版,将其包含在正确的目录中,然后重新启动了apache.
I built it successfully from source since it seems that there are no pre-compiled releases, included it into the right directory and restarted the apache.
但是PHP无法识别该扩展名.我以前使用的1.0.11驱动程序运行良好,但是我需要新版本,因为Doctrines ODM需要它.
But PHP doesn't recognize the extension. I used the 1.0.11 driver previously which worked fine, but I need the new version, because Doctrines ODM requires it.
当我用1.0.11替换1.2.10 mongo.so并重新启动apache mongo时可用.我不明白可能有什么问题.
When I replace the 1.2.10 mongo.so with the 1.0.11 and restart apache mongo is available. I don't get what could be wrong.
有人有这种行为或有任何猜想可以使它起作用吗?
Anyone had this behaviour or any guesses to get this to work?
更新:PHP错误日志显示以下内容:
Update: The PHP error log shows the following:
[01-Jun-2012 22:02:37] PHP Warning: PHP Startup: mongo: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20090626
These options need to match
in Unknown on line 0
我不太清楚这意味着什么吗?
I'm not quite sure what it means?
2.更新:
我终于能够同步phpize
的API版本.
2. Update:
I was finally able to sync the API version of phpize
.
但是现在我不能再构建驱动程序了.
But now I'm not able to build the driver anymore.
我执行以下操作:
phpize
./configure
make
sudo make install
但是在make
命令中,我遇到了大量语法错误.似乎找不到几个头文件.
But at the make
command I'm getting tons of syntax errors. Seems that it can't find several header files.
第一个是zend_config.h
,实际上我只有另外两个文件:
The very first one is the zend_config.h
and really I just have those other two files:
zend_config.nw.h
zend_config.w32.h
我下载了MAMP组件来获取此文件.为什么我想念这个?还有很多其他的东西.
I downloaded the MAMP components to get this files. Why am I missing this one? And there are a lot of others.
我正在使用PHP 5.3.5,是否可以从其他来源获取这些头文件?
I'm using PHP 5.3.5 Is there a way to get those header files from a different source?
推荐答案
I followed the instructions at Develop MongoDB web apps with MAMP under Mac OS X to successfully build mongo.so for MAMP with php 5.3 on OS X 10.7.3.
这篇关于带有MAMP的Mongo PHP驱动程序1.2.10的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!