Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I compile a PHP extension with Microsoft Visual C++ 2008?

I created a PHP Hello World extension DLL with Microsoft Visual C++ 2008. I have the right php.ini (I know because when I enable and disable the gd2 extension, there is an effect), but when I load the extension it does not pop up under the Additional Modules in phpinfo().

When I try to test the function (a simple double() function) it obviously does not work. I used this tutorial).

If someone could supply their dll created when doing this (to see If mine's messed up or if it's my server) then I'd gladly test it.

System Specs

OS: Windows (Vista)
Server: WAMP
PHP: 5.3.5 (Xampp and IIS also installed)

When I run the command php --ini i get this error:

PHP Startup: TalkPHP Extension: Unable to initalize module
Module compiled with build ID=API20090626, TS, VC9.
PHP   compiled with build IF=API20090626, TS, VC6.
These options need to match

Does this mean I have to use Version 9 to compile PHP?

like image 809
Mark Lalor Avatar asked Feb 05 '11 15:02

Mark Lalor


1 Answers

VC9 and VC6 builds are not compatible. You either have to compile your DLL with VC6 or get PHP binaries compiled with VC9 from their download page.

If you are using Apache and mod_php you will also need a VC9 build of Apache to load the VC9 PHP, you can get those from apachehaus.com.

like image 169
Flavio Avatar answered Sep 29 '22 01:09

Flavio