-
在cmd命令行,进入PHP源码包中ext文件下。
执行php 命令生成扩展骨架。
-
修改 test.dsp 文件
查找 SOURCE=.\test.c 将test.c 修改test.cpp
添加 多个cpp文件 如 myadd.cpp
# Begin Source File SOURCE=.\test.cpp SOURCE=.\myadd.cpp # End Source File
-
将test.c 修改为test.cpp ; 新建 myadd.cpp
-
运行命令 msdev test.dsp /MAKE “test - Win32 Release_TS”
php7 c++ 扩展和linux 的扩展方式类似
1 . phpize.bat 生成 configure.js
2. 修改 configure.js 中 EXTENSION 中的内容 和 将本该注释ARG_ENABLE的注释