How do I compile an extension for PHP 5.3 for windows as a DLL?

房东的猫 提交于 2019-11-29 13:39:00

问题


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:

  1. php.exe ext_skel_win32.php --extname=myextension --proto=myprototypefile.dat
  2. Modified config.w32 to uncomment the 'ARG_ENABLE' line and make the default enabled
  3. buildconf.bat
  4. cscript /nologo configure.js
  5. 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?


回答1:


Try

configure.js --enable-myextension=shared

edit: might also be

configure.js --with-myextension=shared


来源:https://stackoverflow.com/questions/1093921/how-do-i-compile-an-extension-for-php-5-3-for-windows-as-a-dll

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!