使用 Visual Studio 2008 编译 php 扩展,MODULE ID 与 php 不匹配
使用 VC9 (2008) 和 VC10 (2010) 编译我自己的 php 扩展后,使用以下步骤:
http://blog.slickedit.com/2007/09/creating-a-php-5-extension-with-visual-c-2005/
我在初始化 php 时遇到下一个错误:
PHP Warning: PHP Startup: FirstPHPExt Module: Unable to initialize module
Module compiled with build ID=API20090626,TS
PHP compiled with build ID=API20090626,TS,VC9
These options need to match
in Unknown on line 0
为什么它没有说我用 VC9 编译了模块?
更多信息:
操作系统:Windows7 x64 PHP:5.3.3,TS,VC9
After compiling my own php extension using VC9 (2008) and VC10 (2010) using the next steps:
http://blog.slickedit.com/2007/09/creating-a-php-5-extension-with-visual-c-2005/
I get the next error when initializing php:
PHP Warning: PHP Startup: FirstPHPExt Module: Unable to initialize module
Module compiled with build ID=API20090626,TS
PHP compiled with build ID=API20090626,TS,VC9
These options need to match
in Unknown on line 0
Why it doesn't says that I compiled the module with VC9?
More info:
Operating System: Windows7 x64
PHP: 5.3.3,TS,VC9
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
好的,我找到了解决方案:
您必须将预处理器常量添加到 php-src/Zend/zend_build.h 中:
它会起作用。
在这里找到解决方案: http://forums.zend.com/viewtopic.php ?f=55&t=2045
Ok, I found the solution:
You must add a preprocessor constant into php-src/Zend/zend_build.h:
And it will work.
Solution found here: http://forums.zend.com/viewtopic.php?f=55&t=2045
构建 PHP 和扩展的官方文档位于 wiki 中。
您应该为您的扩展创建一个 config.w32 文件并通过命令行构建它。这是官方支持的方法。
The official documentation for building PHP and extensions is in the wiki.
You should create a
config.w32
file to your extension and build it through the command line. That's the method that's officially supported.并且强烈建议使用与php本身相同的CRT(VC9)。在 apache、php 或其扩展之间使用混合 CRT 时存在已知问题。
And it is strongly recommended to use the same CRT (VC9) than php itself. There are known issues when mixed CRTs are used between apache, php or its extensions.