需要下载的有:1.php源码,2.cygwin,3.编译器(vc++6.0),4.安装好配置环境变量的php程序
php源码 php5.5.38
这里使用的是php5.5.38源码
下载完成解压到d:/phpsrc目录,在下载cygwin cygwin官网
选择自己系统的位数下载,下载完成安装,在选择网址的时候选择
http://mirrors.sohu.com/cygwin/这个镜像网站比较快,安装完成cygwin.
cmd进入d:/phpsrc/php5.5.38-src/ext目录 运行命令:
php ext_skel_win32.php –extname=test_ext
1. $ cd ..
2. $ vi ext/myphpexs/config.m4
3. $ ./buildconf
4. $ ./configure --[with|enable]-myphpexs
5. $ make
6. $ ./sapi/cli/php -f ext/myphpexs/myphpexs.php
7. $ vi ext/myphpexs/myphpexs.c
8. $ make
Repeat steps 3-6 until you are satisfied with ext/myphpexs/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.
出现这个说明骨架搭建完成。创建了新目录test_ext.进行下一步。用vc打开新目录的dsp项目文件编译dll,把编译好的dll文件放入4中安装好的php程序ext目录
最后在phpini中添加extension=test_ext.dll即可最后在phpinfo()函数中查看即可。以上就是在win10下php拓展环境的搭建。