WAMP环境下(apache2.2.21+Php5.3.10)编写PHP扩展

主要遇到的问题: 1,版本问题:VC9与VC6的问题 具体表现为:
Warning
PHP Startup: MeineExtension: Unable to initialize module
Module compiled with build ID=API20090626,TS
PHP compiled with build ID=API20090626,TS,VC9
These options need to match
解决方法:下载正确的php版本,用正确的编译器 php.net官方说:

If you are using PHP with IIS you should use the VC9 versions of PHP VC6 Versions are compiled with the legacy Visual Studio 6 compiler

所以如果你用apache+php的话,应该用vc6的版本;但如果你想用vc9的版本,像我用了php5.3.10,就要用vc9的IDE,如VS2008,VS2010, 另外,在文件头还要加上一句宏:
#define PHP_COMPILER_ID "VC9"
这个问题纠结了我很久!希望对你有用.. 2,编译问题: 编译中可能会出现 php_stream_transport.h 报错,加上这句话 typedef int socklen_t; 另外,该导入的库都得导入。
原文地址:https://www.cnblogs.com/trying/p/2863726.html