Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 294
Ben Reisner Avatar asked Jul 07 '09 18:07

Ben Reisner


1 Answers

Try

configure.js --enable-myextension=shared

edit: might also be

configure.js --with-myextension=shared
like image 63
VolkerK Avatar answered Oct 07 '22 00:10

VolkerK