Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiling a php extension with Visual Studio 2008, MODULE ID don't match with php

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

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

I get the next 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 it doesn't says that I compiled the module with VC9?

More info:

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

like image 420
Wiliam Avatar asked Apr 07 '26 07:04

Wiliam


2 Answers

Ok, I found the solution:

You must add a preprocessor constant into php-src/Zend/zend_build.h:

#define PHP_COMPILER_ID "VC9"

And it will work.


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

like image 187
Wiliam Avatar answered Apr 09 '26 22:04

Wiliam


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

You should create a config.w32 file to your extension and build it through the command line. That's the method that's officially supported.

like image 35
Artefacto Avatar answered Apr 09 '26 21:04

Artefacto