Compiling php extension with Visual Studio 2008, identifier MODULE does not match php

After compiling my own php extension using VC9 (2008) and VC10 (2010) using the following steps:

http://blog.slickedit.com/2007/09/creating-a-php-5-extension-with-visual-c-2005/

I get the following 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 doesn't he say that I compiled the module with VC9 ?

Additional Information:

Operating System: Windows7 x64 PHP: 5.3.3, TS, VC9

+3
php pecl visual-c ++ - 2008 php-extension
source share
3 answers

Ok, I found a solution:

You must add the preprocessor constant in php-src / Zend / zend_build.h :

 #define PHP_COMPILER_ID "VC9" 

And he will work.


The solution is found here: http://forums.zend.com/viewtopic.php?f=55&t=2045

+10
source share

The official documentation for creating PHP and extensions is in the wiki .

You must create a config.w32 file for your extension and create it through the command line. This is the method that is officially supported.

+2
source share

And it is strongly recommended that you use the same CRT (VC9) as php itself. Problems are known when mixed CRTs are used between apache, php or its extensions.

0
source share

All Articles