如何将适用于 Windows 的 PHP 5.3 扩展编译为 DLL?
我目前正在重写最初为 PHP 4.2.2 编写的
我的问题是让构建/编译过程生成 PHP
扩展。.dll 而不是将扩展编译到
PHP
核心中。 环境是windows server 2003。我使用的是Visual Studio 2008。
我使用EXT_SKEL脚本生成框架,并且我可以成功地将扩展编译到php核心中。 我正在尝试将其编译为 .dll
,以便我可以轻松地将其分发给我的客户。 谁能告诉我正确的方向,如何告诉 PHP 5.3
构建过程,我想将我的扩展编译为 .dll
而不是静态地编译为 PHP 本身?
要构建扩展的框架,我运行:
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 二进制文件。 有人能指出我正确的方向吗?
I'm currently rewriting a PHP
Extension that was originally written for PHP 4.2.2.
My issue is having the build/compile process generate a .dll
instead of compiling the extension into the PHP
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 the PHP 5.3
build process that i'd like to compile my extension as a .dll
instead of staticly into PHP
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试
编辑:也可能是
Try
edit: might also be