<?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>IT狂人的博客 &#187; windows</title>
	<atom:link href="http://www.yinzhili.com/tag/windows/feed" rel="self" type="application/rss+xml" />
	<link>http://www.yinzhili.com</link>
	<description>世界上有10种人:一种是懂二进制的，另一种是不懂的。</description>
	<lastBuildDate>Thu, 22 Jul 2010 03:51:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>在Windows下编译适用于PHP 5.2.12及5.2.13的eAccelerator.dll(附下载)</title>
		<link>http://www.yinzhili.com/2010/02/build-eaccelerator-for-php-5-2-12-or-5-2-13-on-windows.html</link>
		<comments>http://www.yinzhili.com/2010/02/build-eaccelerator-for-php-5-2-12-or-5-2-13-on-windows.html#comments</comments>
		<pubDate>Fri, 26 Feb 2010 08:10:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[eaccelerator]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.yinzhili.com/?p=145</guid>
		<description><![CDATA[最近PHP 5.2.12及5.2.13发布了，修复了多个bug，因此升级到这一版本是非常必要的。
首先说明一下我的一些参数：
操作系统: Windows 7 Ultimate
Web Server：Apache 2.2.14
Visual Studio: 6.0 (别嫌弃它版本老，即便是在Win7下[......]<p class='read-more'><a href='http://www.yinzhili.com/2010/02/build-eaccelerator-for-php-5-2-12-or-5-2-13-on-windows.html'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p>最近PHP 5.2.12及5.2.13发布了，修复了多个bug，因此升级到这一版本是非常必要的。</p>
<p>首先说明一下我的一些参数：<br />
操作系统: Windows 7 Ultimate<br />
Web Server：Apache 2.2.14<br />
Visual Studio: 6.0 (别嫌弃它版本老，即便是在Win7下它还是能用的，当然你用Visual Studio 2008也行)</p>
<p>什么是eAccelerator？<br />
eaccelerator是一个自由开放源码php加速器，优化和动态内容缓存，提高了性能php脚本的缓存性能，使得PHP脚本在编译的状态下，对服务器的开销几乎完全消除。 它还有对脚本起优化作用，以加快其执行效率。</p>
<p>1.首先下载编译好的PHP二进制包。(稍后会用到) 地址如下：<br />
<span style="color: #3366ff;">http://cn.php.net/distributions/php-5.2.12-Win32.zip</p>
<p>http://cn.php.net/distributions/php-5.2.13-Win32.zip</span></p>
<p>2.再下载PHP的源代码，稍后编译eAccelerator的时候会用到。地址如下：<br />
<span style="color: #3366ff;">http://cn2.php.net/get/php-5.2.12.tar.bz2/from/a/mirror</p>
<p>http://cn2.php.net/get/php-5.2.13.tar.bz2/from/a/mirror</span></p>
<p>3.升级PHP：<br />
这一过程很简单，首先关闭Apache，然后将压缩包里解压出来的所有文件替换掉原来的文件即可。例如你原来的PHP程序文件位于 D:\php，那么请将php-5.2.13-Win32.zip(或者php-5.2.12-Win32.zip)解压到这一路径下覆盖原有文件。</p>
<p>4.启动Apache，我们会收到一条报错信息，Apache无法启动。打开Apache的日志文件(此文件路径为apache\logs\error.log)，我们会看到这样的提示信息：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">PHP Warning<span style="color: #339933;">:</span>  <span style="color: #009900;">&#91;</span>eAccelerator<span style="color: #009900;">&#93;</span> This build of <span style="color: #0000ff;">&quot;eAccelerator&quot;</span> was compiled <span style="color: #b1b100;">for</span> PHP version 5<span style="color: #339933;">.</span>2<span style="color: #339933;">.</span>11<span style="color: #339933;">.</span>
Rebuild it <span style="color: #b1b100;">for</span> your PHP version <span style="color: #009900;">&#40;</span>5<span style="color: #339933;">.</span>2<span style="color: #339933;">.</span>13<span style="color: #009900;">&#41;</span> or download precompiled binaries<span style="color: #339933;">.</span></pre></div></div>

<p>意思就是当前的eAccelerator是为PHP 5.2.11编译的，不适用于5.2.13。我们应该重新编译一份eAccelerator。</p>
<p>5.下载一份eAccelerator的源码。地址如下：<br />
<span style="color: #3366ff;">http://bart.eaccelerator.net/source/0.9.5.3/eaccelerator-0.9.5.3.zip</span></p>
<p>6.将第2步骤下载到的PHP源码解压到某一目录下，例如 E:\php。然后打开你的PHP程序目录(也就是你的php.exe所在的目录)，找到其中dev子目录下的php5ts.lib文件，把它复制到E:\php这一位置。</p>
<p>7.打开E:\php\ext，在这下面创建一个目录命名为eaccelerator，然后将第5步骤下载到的压缩包解压到此目录下。此时的目录结构应该是这样的：</p>
<div id="attachment_146" class="wp-caption aligncenter" style="width: 198px"><a href="http://www.yinzhili.com/wp-content/uploads/2009/12/1.png"><img class="size-medium wp-image-146" title="图1" src="http://www.yinzhili.com/wp-content/uploads/2009/12/1.png" alt="图1" width="188" height="502" /></a><p class="wp-caption-text">图1</p></div>
<p>8.打开win32子目录，其中应该有一个名叫eAccelerator.dsw的项目文件，用VS开发环境打开它(比如我用的就是VS6.0)，打开&#8221;组件&#8221;&gt;&#8221;配置&#8221;，选中 Win32 Release PHP5 这一选项，单击“关闭”。</p>
<div id="attachment_147" class="wp-caption aligncenter" style="width: 456px"><a href="http://www.yinzhili.com/wp-content/uploads/2009/12/2.png"><img class="size-medium wp-image-147" title="图2" src="http://www.yinzhili.com/wp-content/uploads/2009/12/2.png" alt="图2" width="446" height="228" /></a><p class="wp-caption-text">图2</p></div>
<p>9.按下F7键(或选择工具条中的编辑按钮)开始编译，稍等片刻，编译成功，你就可以在win32目录下看到生成了一个Release子目录，打开这个子目录，你就会看到已经生成了eAccelerator.dll文件。<br />
将这个文件复制到你的PHP扩展目录下(如D:\php\ext)，替换掉原有的文件，然后启动Apache，你就会发现eAccelerator已经成功加载了。</p>
<div id="attachment_148" class="wp-caption aligncenter" style="width: 615px"><a href="http://www.yinzhili.com/wp-content/uploads/2009/12/3.png"><img class="size-full wp-image-148" title="图3" src="http://www.yinzhili.com/wp-content/uploads/2009/12/3.png" alt="图3" width="605" height="258" /></a><p class="wp-caption-text">图3</p></div>
<h3>或者</h3>
<p><a href="http://www.yinzhili.com/downloads/binary/eAccelerator_dll_for_php_5_2_13.zip">猛击此处下载编译好的dll文件</a></p>
<p>Visual Studio 2008下编译可能会出现类似于“<span style="color: #ff0000;">不能分配常量大小为 0 的数组</span>”这样的报错信息，解决办法如下：</p>
<blockquote><p>找到源码目录的main子目录，打开它，找到以下文件：<br />
config.w32.h<br />
 <br />
在这个文件里查找 #define _USE_32BIT_TIME_T 1，将这一行注释掉。再重新编译即可。</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.yinzhili.com/2010/02/build-eaccelerator-for-php-5-2-12-or-5-2-13-on-windows.html/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
