标签:
项目中需要使用runkit模块实现AOP,但是团队成员的开发环境都是Windows,而runkit模块官方没有提供Windows环境下的dll扩展,只能自己编译。
下面是编译过程的分类总结。(操作系统环境为Windows 10 64位中文旗舰版)
cd c:\php-sdk\
bin\phpsdk_buildtree.bat phpdev
会在c:\php-sdk文件夹下生成phpdev文件夹,其中包含vc6、vc8、vc9子文件夹。
如果使用MSVC11编译PHP,就复制c:\php-sdk\phpdev\vc9到c:\php-sdk\phpdev\vc11。
如果使用MSVC14编译PHP,就复制c:\php-sdk\phpdev\vc9到c:\php-sdk\phpdev\vc14。
下面是具体的编译步骤,有些内容会出现重复,是为了让偷懒的同学按图索骥,有样学样:)
可能遇到的问题:
regsvr32 %WINDIR%\System32\jscript.dll
regsvr32 %WINDIR%\SysWOW64\jscript.dll
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.js]
@="jsfile"
[HKEY_CLASSES_ROOT\.js\PersistentHandler]
@="{5e941d80-bf96-11cd-b579-08002b30bfeb}"
[HKEY_CLASSES_ROOT\JSFile]
"FriendlyTypeName"=hex(2):40,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,\
00,6f,00,6f,00,74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,\
32,00,5c,00,77,00,73,00,68,00,65,00,78,00,74,00,2e,00,64,00,6c,00,6c,00,2c,\
00,2d,00,34,00,38,00,30,00,34,00,00,00
[HKEY_CLASSES_ROOT\JSFile\ScriptEngine]
@="JScript"
[HKEY_CLASSES_ROOT\JSFile\ScriptHostEncode]
@="{85131630-480C-11D2-B1F9-00C04F86C324}"
[HKEY_CLASSES_ROOT\JSFile\Shell]
@="Open"
[HKEY_CLASSES_ROOT\JSFile\Shell\Open\Command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,57,00,53,00,\
63,00,72,00,69,00,70,00,74,00,2e,00,65,00,78,00,65,00,20,00,22,00,25,00,31,\
00,22,00,20,00,25,00,2a,00,00,00
[HKEY_CLASSES_ROOT\JSFile\Shell\Open2]
@=hex(2):4f,00,70,00,65,00,6e,00,20,00,26,00,77,00,69,00,74,00,68,00,20,00,43,\
00,6f,00,6d,00,6d,00,61,00,6e,00,64,00,20,00,50,00,72,00,6f,00,6d,00,70,00,\
74,00,00,00
"MUIVerb"=hex(2):40,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,\
6f,00,74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,\
00,77,00,73,00,68,00,65,00,78,00,74,00,2e,00,64,00,6c,00,6c,00,2c,00,2d,00,\
34,00,35,00,31,00,31,00,00,00
[HKEY_CLASSES_ROOT\JSFile\Shell\Open2\Command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,43,00,53,00,\
63,00,72,00,69,00,70,00,74,00,2e,00,65,00,78,00,65,00,20,00,22,00,25,00,31,\
00,22,00,20,00,25,00,2a,00,00,00
[HKEY_CLASSES_ROOT\JSFile\Shell\Print\Command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,4e,00,6f,00,\
74,00,65,00,70,00,61,00,64,00,2e,00,65,00,78,00,65,00,20,00,2f,00,70,00,20,\
00,25,00,31,00,00,00
[HKEY_CLASSES_ROOT\JSFile\ShellEx\DropHandler]
@="{60254CA5-953B-11CF-8C96-00AA00B8708C}"
[HKEY_CLASSES_ROOT\JSFile\ShellEx\PropertySheetHandlers\WSHProps]
@="{60254CA5-953B-11CF-8C96-00AA00B8708C}"
[HKEY_CLASSES_ROOT\JScript]
@="JScript Language"
[HKEY_CLASSES_ROOT\JScript\CLSID]
@="{f414c260-6ac0-11cf-b6d1-00aa00bbbb58}"
[HKEY_CLASSES_ROOT\JScript\OLEScript]
PS:
实践过程中,主要参考如下三篇文章,仅向原作者致谢:
在Windows系统中使用VC9、VC11编译32位、64位PHP及其扩展
标签:
原文地址:http://www.cnblogs.com/matchless/p/5170785.html