过程:
1,安装 VC++6.0,并选择把其可执行文件路径加入环境变量中,使在命令行环境任意路径下可以运行编译器。
2,安装 PHP 运行环境,并与 IIS 正确集成在一起。假设使用的 PHP 版本为 5.2.5,下载 php-5.2.5-Win32.zip 二进制包和 php-5.2.5.tar.gz 源代码包。安装环境为 C:php-5.2.5-Win32。分别把源代码包和二进制包解压到该文件夹下。从 php.ini-recommended 拷贝生成一个 php.ini 文件。
3,建立 C:php-5.2.5-Win32Release_TS 文件夹,拷贝 C:php-5.2.5-Win32devphp5ts.lib 文件到这里。
4,进入 C:php-5.2.5-Win32ext 文件夹,运行命令:
C:php-5.2.5-Win32ext>..php.exe ext_skel_win32.php --extname=myphpext
Creating directory myphpext
Creating basic files: config.m4 config.w32 .cvsignore myphpext.c php_myphpext.h
CREDITS EXPERIMENTAL tests/001.phpt myphpext.php [done].
To use your new extension, you will have to execute the following steps:
1. $ cd ..
2. $ vi ext/myphpext/config.m4
3. $ ./buildconf
4. $ ./configure --[with|enable]-myphpext
5. $ make
6. $ ./php -f ext/myphpext/myphpext.php
7. $ vi ext/myphpext/myphpext.c
8. $ make
Repeat steps 3-6 until you are satisfied with ext/myphpext/config.m4 and
step 6 confirms that your module is compiled into PHP. Then, start writing
code and repeat the last two steps as often as necessary.