我如何编译PHP 5.3的扩展为Windows作为DLL? [英] How do I compile an extension for PHP 5.3 for windows as a DLL?
问题描述
我目前正在重写 PHP
扩展程序,最初是为 PHP 4.2.2。
编写的。我的问题是有build / compile过程生成 .dll
,而不是将扩展编译到 PHP
核心。环境是windows server 2003.我使用Visual Studio 2008.
我使用EXT_SKEL脚本生成框架,我可以成功地将扩展编译为PHP核心。我试图改为编译为 .dll
,所以我可以很容易地分发给我的客户。任何人都可以指向我正确的方向,如何告诉 PHP 5.3
构建过程,我想编译我的扩展为 .dll
而不是静态到 PHP
本身?
要构建扩展的框架, / p>
-
php.exe
ext_skel_win32.php --extname = myextension --proto = myprototypefile.dat
- 修改config.w32以取消注释'ARG_ENABLE'行并启用默认值
-
buildconf.bat
-
cscript / nologo configure.js
- nmake
我确认可以从PHP运行扩展的方法,不产生可分发的.dll。而是将这些方法编译成PHP二进制文件。
尝试
configure.js --enable-myextension = shared
也可以是
configure.js --with-myextension = shared
pre>
I'm currently rewriting a
PHP
Extension that was originally written forPHP 4.2.2.
My issue is having the build/compile process generate a.dll
instead of compiling the extension into thePHP
core. The environment is windows server 2003. I'm using Visual Studio 2008.I used the EXT_SKEL script to generate the framework, and I can succesfully compile the extension into the php core. I'm trying to instead compile it as a
.dll
so I can easily distribute it to my clients. Can anyone point me in the right direction for how to tell thePHP 5.3
build process that i'd like to compile my extension as a.dll
instead of staticly intoPHP
itself?To build the extension's framework I run:
php.exe
ext_skel_win32.php --extname=myextension --proto=myprototypefile.dat
- Modified config.w32 to uncomment the 'ARG_ENABLE' line and make the default enabled
buildconf.bat
cscript /nologo configure.js
- nmake
I confirm that I can run the extension's methods from within PHP, however it does not produce a distributable .dll. instead it compiles the methods into the PHP binary. Can anyone point me in the right direction?
解决方案Try
configure.js --enable-myextension=shared
edit: might also be
configure.js --with-myextension=shared
这篇关于我如何编译PHP 5.3的扩展为Windows作为DLL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!