<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>潘锦的空间 &#187; 使用VC6.0</title>
	<atom:link href="https://www.phppan.com/tag/%e4%bd%bf%e7%94%a8vc6-0/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.phppan.com</link>
	<description>SaaS SaaS架构 团队管理 技术管理 技术架构 PHP 内核 扩展 项目管理</description>
	<lastBuildDate>Sat, 04 Apr 2026 01:19:58 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=3.9.40</generator>
	<item>
		<title>使用VC6.0生成VLD扩展</title>
		<link>https://www.phppan.com/2009/09/use-vc6-create-vld-extend/</link>
		<comments>https://www.phppan.com/2009/09/use-vc6-create-vld-extend/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 15:00:36 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP扩展]]></category>
		<category><![CDATA[VLD]]></category>
		<category><![CDATA[VLD扩展]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[使用VC6.0]]></category>

		<guid isPermaLink="false">http://www.phppan.com/?p=212</guid>
		<description><![CDATA[使用VC6.0生成VLD扩展 最近想看看PHP生成的源码是啥样子，于是google半天，终于完成。 环境：VC [&#8230;]]]></description>
				<content:encoded><![CDATA[<div class="mceTemp mceIEcenter">使用VC6.0生成VLD扩展</div>
<p>最近想看看PHP生成的源码是啥样子，于是google半天，终于完成。<br />
环境：VC6.0<br />
源码：php5.2.9源码包（可以去http://www.php.net/下载），解压，我的是解压在D盘根目录下。<br />
Vld源码包（可以去http://pecl.php.net/package/vld/0.9.1下载），解压</p>
<p>生成过程如下：<br />
1、在Windows平台启动 VC++ 6.0, 【文件】（File）-&gt;【新建】（New）, 在 【工程】（Project）中选择 【Win32 Dynamic-Link Library】, 填写上 【工程名称】（Project Name） 和 【位置】（Location）,如图1所示：</p>
<div id="attachment_213" style="width: 564px" class="wp-caption aligncenter"><img class="size-full wp-image-213" title="ddc7csbs_12dckzpvhj_b" src="http://www.phppan.com/wp-content/uploads/2009/09/ddc7csbs_12dckzpvhj_b.png" alt="图1" width="554" height="364" /><p class="wp-caption-text">图1</p></div>
<p>2、点击确定后，在第二屏选中 【一个空的DLL工程】（An empty DLL project）, 点 【完成】Finish， 完成创建。此时会可能会弹出一个信息框，点击确定。</p>
<p>3、把解压后的vld源码中的vld文件夹下面的所有文件拷贝到到工程所在的目录（D:\php-5.2.9\ext\vld）;</p>
<p>4、选择左侧的【Source Files】，点击右键，选择【添加文件到目录】，将D:\php-5.2.9\ext\vld目录下的所有C文件添加到此目录，如图2所示;</p>
<div id="attachment_214" style="width: 305px" class="wp-caption aligncenter"><img class="size-full wp-image-214" title="ddc7csbs_13cd8tgrdg_b" src="http://www.phppan.com/wp-content/uploads/2009/09/ddc7csbs_13cd8tgrdg_b.png" alt="图2" width="295" height="281" /><p class="wp-caption-text">图2</p></div>
<p><span style="COLOR: #000000; FONT-FAMILY: 'Times New Roman'"><span style="font-size: x-small;">5、同样选择【Header Files】，添加所有的头文件到目录。如图3所示：</span></span></p>
<div id="attachment_215" style="width: 326px" class="wp-caption aligncenter"><a href="http://www.phppan.com/wp-content/uploads/2009/09/3.png"><img class="size-full wp-image-215" title="图3" src="http://www.phppan.com/wp-content/uploads/2009/09/3.png" alt="图3" width="316" height="353" /></a><p class="wp-caption-text">图3</p></div>
<p>6、修改工程设置，选择【工程】（Project）-&gt;【设置】（Settings）-&gt;【C/C++】，在【工程选项】（Project Options:）的 最后加上 /Tc，在预处理程序定义中添加如下宏定义：ZEND_DEBUG=0,COMPILE_DL_VLD,ZTS=1,ZEND_WIN32,PHP_WIN32,HAVE_VLD=1</p>
<p>如果你需要编译其它扩展，请将COMPILE_DL_VLD 和 HAVE_VLD=1，后面的 &#8220;VLD&#8221; 改成和你要创建的工程名一致。</p>
<p>如图4所示：</p>
<p style="MARGIN-LEFT: 0pt; MARGIN-RIGHT: 0pt"><span style="COLOR: #000000; FONT-FAMILY: 'Times New Roman'"><span style="font-size: x-small;"> </span></span></p>
<div>
<div id="attachment_216" style="width: 564px" class="wp-caption aligncenter"><a href="http://www.phppan.com/wp-content/uploads/2009/09/4.png"><img class="size-full wp-image-216" title="vld-4" src="http://www.phppan.com/wp-content/uploads/2009/09/4.png" alt="图4" width="554" height="370" /></a><p class="wp-caption-text">图4</p></div>
</div>
<p>7、选择【连接】（Link），在【对象/库模块】(Object/library modules)添加php5ts.lib，注意要以空格格开;</p>
<p>8、选择【工具】(Tools)-&gt;【选项】(Options)-&gt;【目录】（Directories），</p>
<p>在 【目录】（Show directories for:） 下拉框中选择 &#8220;Library files&#8221;，在 【路径】（Directories） 中添加 D:\php-5.2.9 （即 php5ts.lib 所在目录）；如图5所示：</p>
<p>在【目录】（Show directories for:） 下拉框中选择 &#8220;Include files&#8221;</p>
<p>在【路径】（Directories）中添加 D:\PHP-5.2.9 （即 ext、regex、win32 所在目录）</p>
<p>在【路径】（Directories）中添加 D:\PHP-5.2.9\MAIN</p>
<p>在【路径】（Directories）中添加D:\PHP-5.2.9\ZEND</p>
<p>在【路径】（Directories）中添加 D:\PHP-5.2.9\TSRM</p>
<p>如图6所示： </p>
<p style="TEXT-ALIGN: center"> </p>
<div id="attachment_217" style="width: 563px" class="wp-caption aligncenter"><a href="http://www.phppan.com/wp-content/uploads/2009/09/5.png"><img class="size-full wp-image-217" title="vld-5" src="http://www.phppan.com/wp-content/uploads/2009/09/5.png" alt="图5" width="553" height="389" /></a><p class="wp-caption-text">图5</p></div>
<div> </div>
<p style="TEXT-ALIGN: center"> </p>
<div id="attachment_218" style="width: 563px" class="wp-caption aligncenter"><a href="http://www.phppan.com/wp-content/uploads/2009/09/6.png"><img class="size-full wp-image-218" title="6" src="http://www.phppan.com/wp-content/uploads/2009/09/6.png" alt="图6" width="553" height="389" /></a><p class="wp-caption-text">图6</p></div>
<p style="MARGIN-LEFT: 0pt; MARGIN-RIGHT: 0pt"><span style="FONT-FAMILY: 'Times New Roman'"><span style="font-size: small;">9</span></span><span style="FONT-FAMILY: 'Times New Roman'"><span style="font-size: small;">、选择【组建】</span></span><span style="FONT-FAMILY: 'Times New Roman'"><span style="font-size: small;">-&gt;</span></span><span style="FONT-FAMILY: 'Times New Roman'"><span style="font-size: small;">【编译】，此时可能会出现报错。</span></span></p>
<p style="MARGIN-LEFT: 0pt; MARGIN-RIGHT: 0pt"><span style="FONT-FAMILY: 'Times New Roman'"><span style="font-size: small;">在</span></span><span style="FONT-FAMILY: 'Times New Roman'"><span style="font-size: small;">php_vld.h</span></span><span style="FONT-FAMILY: 'Times New Roman'"><span style="font-size: small;">文件的</span></span><span style="FONT-FAMILY: 'Times New Roman'"><span style="font-size: small;">59</span></span><span style="FONT-FAMILY: 'Times New Roman'"><span style="font-size: small;">行存在三个莫名其妙的点，将他们去掉就可以了。</span></span></p>
<p style="MARGIN-LEFT: 0pt; MARGIN-RIGHT: 0pt"><span style="FONT-FAMILY: 'Times New Roman'"><span style="font-size: small;">10</span></span><span style="FONT-FAMILY: 'Times New Roman'"><span style="font-size: small;">、选择【组建】</span></span><span style="FONT-FAMILY: 'Times New Roman'"><span style="font-size: small;">-&gt;</span></span><span style="FONT-FAMILY: 'Times New Roman'"><span style="font-size: small;">【组建】。成功！</span></span></p>
<p style="MARGIN-LEFT: 0pt; MARGIN-RIGHT: 0pt"><span style="FONT-FAMILY: 'Times New Roman'"><span style="font-size: small;">在扩展下的</span></span><span style="FONT-FAMILY: 'Times New Roman'"><span style="font-size: small;">Debug</span></span><span style="FONT-FAMILY: 'Times New Roman'"><span style="font-size: small;">目录</span></span><span style="FONT-FAMILY: 'Times New Roman'"><span style="font-size: small;">（</span></span><span style="FONT-FAMILY: 'Times New Roman'"><span style="font-size: small;">D:\php-5.2.9\ext\vld\Debug</span></span><span style="FONT-FAMILY: 'Times New Roman'"><span style="font-size: small;">）</span></span><span style="FONT-FAMILY: 'Times New Roman'"><span style="font-size: small;">下有一个生成的</span></span><span style="FONT-FAMILY: 'Times New Roman'"><span style="font-size: small;">dll</span></span><span style="FONT-FAMILY: 'Times New Roman'"><span style="font-size: small;">文件。</span></span><span style="FONT-FAMILY: 'Times New Roman'"><span style="font-size: small;">这就是我们</span></span><span style="FONT-FAMILY: 'Times New Roman'"><span style="font-size: small;">所要的东东了！</span></span></p>
<div class="mceTemp mceIEcenter"> </div>
]]></content:encoded>
			<wfw:commentRss>https://www.phppan.com/2009/09/use-vc6-create-vld-extend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
