/*This script can be used on Win systems) Make sure you have CygWin installed) Adjust the $cygwin_path to match your installation) Change the environment cariable PATHEXT to include .PHP) run ext_skel --extname=...the first time you run this script you will be asked toassociate it with a program. chooses the CLI version of php.*/$cygwin_path = "D:Program Filescygwinin";这里改成你的cygwin安装目录。

记得将php.exe 所在目录加入path,--extname=你的扩展名字,
若成功会再ext目录下生成myphpexs文件夹,内容如下

4、用vs2008 打开myphpexs.dsp, 解决方案配置改为Release,执行生成命令
顺利的话将生成php_myphpexs.dll文件,我的将php_myphpexs.dll生成再了php源码根目录的Release_TS文件夹中
5、将php_myphpexs.dll放到你php的扩展目录,再php.ini中加上extension=php_myphpexs.dll
6、新建php脚本文件test.php,内容如下
复制代码 代码如下:
echo confirm_myphpexs_compiled("test");
7、运行测试文件,出现如下内容说明,成功了
复制代码 代码如下:
Congratulations! You have successfully modified ext/myphpext/config.m4. Module 23 is now compiled into PHP.
8、confirm_myphpexs_compiled是建立扩展是自带的册数函数,在编辑你自己的扩展内容时,可以删除改函数