<?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>简单生活@NET &#187; 深入PHP</title>
	<atom:link href="http://lee.kometo.com/archives/tag/%e6%b7%b1%e5%85%a5php/feed" rel="self" type="application/rss+xml" />
	<link>http://lee.kometo.com</link>
	<description>正确的判断来自经验，但经验往往来自错误的判断</description>
	<lastBuildDate>Mon, 06 Feb 2012 02:26:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Eclipse+PDT：PHP内置函数不能正常进行代码提示！</title>
		<link>http://lee.kometo.com/archives/308</link>
		<comments>http://lee.kometo.com/archives/308#comments</comments>
		<pubDate>Sun, 12 Jul 2009 10:18:41 +0000</pubDate>
		<dc:creator>Emeric lee</dc:creator>
				<category><![CDATA[深入PHP]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[pdt]]></category>

		<guid isPermaLink="false">http://lee.kometo.com/?p=308</guid>
		<description><![CDATA[Eclipse+PDT：PHP内置（Core）函数不能正常进行代码提示(Code Assite)！ 解决方法： 编辑.project 文件 ，删除&#60;buildSpec&#62;节点，重新关闭打开项目，然后测试下 .project 文件大概类似如下内容： &#60;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34;?&#62; &#60;projectDescription&#62; &#60;name&#62;name&#60;/name&#62; &#60;comment&#62;&#60;/comment&#62; &#60;projects&#62; &#60;/projects&#62; &#60;buildSpec&#62; &#60;buildCommand&#62; &#60;name&#62;org.eclipse.wst.validation.validationbuilder&#60;/name&#62; &#60;arguments&#62; &#60;/arguments&#62; &#60;/buildCommand&#62; &#60;buildCommand&#62; &#60;name&#62;org.eclipse.dltk.core.scriptbuilder&#60;/name&#62; &#60;arguments&#62; &#60;/arguments&#62; &#60;/buildCommand&#62; &#60;/buildSpec&#62; &#60;natures&#62; &#60;nature&#62;org.eclipse.php.core.PHPNature&#60;/nature&#62; &#60;nature&#62;org.eclipse.wst.jsdt.core.jsNature&#60;/nature&#62; &#60;/natures&#62; &#60;/projectDescription&#62;]]></description>
			<content:encoded><![CDATA[<p>Eclipse+PDT：PHP内置（Core）函数不能正常进行代码提示(Code Assite)！</p>
<p>解决方法：</p>
<p>编辑<strong>.project </strong>文件 ，删除&lt;buildSpec&gt;节点，重新关闭打开项目，然后测试下</p>
<p><strong>.project </strong>文件大概类似如下内容：</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;projectDescription<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>name<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;comment<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/comment<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;projects<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/projects<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;buildSpec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;buildCommand<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.eclipse.wst.validation.validationbuilder<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arguments<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/arguments<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/buildCommand<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;buildCommand<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.eclipse.dltk.core.scriptbuilder<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arguments<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/arguments<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/buildCommand<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/buildSpec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;natures<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;nature<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.eclipse.php.core.PHPNature<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/nature<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;nature<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.eclipse.wst.jsdt.core.jsNature<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/nature<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/natures<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/projectDescription<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://lee.kometo.com/archives/308/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySql升级及PHP连接库相关问题</title>
		<link>http://lee.kometo.com/archives/300</link>
		<comments>http://lee.kometo.com/archives/300#comments</comments>
		<pubDate>Mon, 06 Jul 2009 14:20:15 +0000</pubDate>
		<dc:creator>Emeric lee</dc:creator>
				<category><![CDATA[深入PHP]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://lee.kometo.com/?p=300</guid>
		<description><![CDATA[PHP 5.3开始使用MySqlND作为默认的MySql访问驱动，而且从这个版本开始将不再支持使用旧的用户接口链接Mysql了，你可能会看到类似的提示： #2000 - mysqlnd cannot connect to MySQL 4.1+ using old authentication 解决问题的方法不是调整PHP，而是检查你的Mysql，你需要确保两件事： 你使用的Mysql是4.1+以上版本，4.1以前的版本只支持使用老的16位密码存储 你准备用于连接的数据库帐号使用的MySql的新密码格式（41位的数据） 解决问题2的方法是重新设置账户的密码，并确保使用的标准Password（）函数设置账户密码，相关指令如下： -- 选择系统库 USE `mysql` -- 显示当前的用户和密码，注意新的的密码格式应该是41位的加密字符，老的是16位的 SELECT `user`,`password` FROM `user`; &#160; -- 更新指定的用户的密码，注意使用函数 password() -- 有时针对一些特殊需要，你可以使用old_password()函数来建立一个或几个向下兼容的数据库账户 UPDATE `user` SET `password`=password&#40;'newpassword'&#41; WHERE `user`='UserName'; &#160; -- 刷新MySql权限库 FLUSH PRIVILEGES; &#160; -- 最后别忘记了,MySql的命令行连接方式是： MySql -u username@host -p password]]></description>
			<content:encoded><![CDATA[<p>PHP 5.3开始使用MySqlND作为默认的MySql访问驱动，而且从这个版本开始将不再支持使用旧的用户接口链接Mysql了，你可能会看到类似的提示：</p>
<pre><span style="color: #ff0000;"><strong>#2000 - mysqlnd cannot connect to MySQL 4.1+ using old authentication</strong></span></pre>
<p>解决问题的方法不是调整PHP，而是检查你的Mysql，你需要确保两件事：</p>
<ul>
<li>你使用的Mysql是4.1+以上版本，4.1以前的版本只支持使用老的16位密码存储</li>
<li>你准备用于连接的数据库帐号使用的MySql的新密码格式（41位的数据）</li>
</ul>
<p>解决问题2的方法是重新设置账户的密码，并确保使用的标准Password（）函数设置账户密码，相关指令如下：</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">-- 选择系统库</span>
<span style="color: #993333; font-weight: bold;">USE</span> <span style="color: #ff0000;">`mysql`</span>
<span style="color: #808080; font-style: italic;">-- 显示当前的用户和密码，注意新的的密码格式应该是41位的加密字符，老的是16位的</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #ff0000;">`user`</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">`password`</span> <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #ff0000;">`user`</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">-- 更新指定的用户的密码，注意使用函数 password()</span>
<span style="color: #808080; font-style: italic;">-- 有时针对一些特殊需要，你可以使用old_password()函数来建立一个或几个向下兼容的数据库账户</span>
<span style="color: #993333; font-weight: bold;">UPDATE</span> <span style="color: #ff0000;">`user`</span> <span style="color: #993333; font-weight: bold;">SET</span> <span style="color: #ff0000;">`password`</span><span style="color: #66cc66;">=</span>password<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'newpassword'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">WHERE</span> <span style="color: #ff0000;">`user`</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'UserName'</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">-- 刷新MySql权限库</span>
<span style="color: #993333; font-weight: bold;">FLUSH</span> PRIVILEGES;
&nbsp;
<span style="color: #808080; font-style: italic;">-- 最后别忘记了,MySql的命令行连接方式是：</span>
MySql <span style="color: #66cc66;">-</span>u username@host <span style="color: #66cc66;">-</span>p password</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://lee.kometo.com/archives/300/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>使用Xdebug调试PHP程序</title>
		<link>http://lee.kometo.com/archives/296</link>
		<comments>http://lee.kometo.com/archives/296#comments</comments>
		<pubDate>Wed, 01 Jul 2009 15:33:39 +0000</pubDate>
		<dc:creator>Emeric lee</dc:creator>
				<category><![CDATA[WEB应用开发]]></category>
		<category><![CDATA[深入PHP]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[xdebug]]></category>

		<guid isPermaLink="false">http://lee.kometo.com/?p=296</guid>
		<description><![CDATA[XDebug是个好东西啊，用来调试PHP程序的，可以和Eclipse配合。 配置步骤：（Windows+Apache+php环境） 1.下载和PHP版本环境相适应的XDebug版本，放置于PHP目录，主要None-ThreadSafe版似乎是用来在CLI方式下使用的，一般不需要 2.修改php.ini文件，参考如下 &#91;Xdebug&#93; ;zend_extension_ts = &#34;D:\server\php5\ext\php_xdebug-2.0.5-5.3-vc6.dll&#34; ;发现在PHP5.3+Apache（CGI）方式下，似乎必须使用 zend_extension 加载才能成功 zend_extension = &#34;D:\server\php5\ext\php_xdebug-2.0.5-5.3-vc6-nts.dll&#34; &#160; xdebug.auto_trace = off ;开启自动跟踪 &#160; xdebug.remote_autostart = off ;开启远程调试自动启动 xdebug.remote_enable = 1 xdebug.remote_host = 10.5.184.251 xdebug.remote_port = 9000 ;xdebug.remote_handler = “dbgp” &#160; xdebug.show_exception_trace = On ;开启异常跟踪 &#160; xdebug.collect_vars = On ;收集变量 xdebug.collect_return = On ;收集返回值 xdebug.collect_params = On ;收集参数 注意：remote_host应该填写远程调试机的地址，而不是PHP服务器的地址，在Xdebug运行方式下，调试工具实际是调试过程的服务端，Xdebug会主动连接指定的remoete_host，从而建立调试通讯。所以要注意调试机的防火墙问题 [...]]]></description>
			<content:encoded><![CDATA[<p>XDebug是个好东西啊，用来调试PHP程序的，可以和Eclipse配合。</p>
<p>配置步骤：（Windows+Apache+php环境）</p>
<p>1.下载和PHP版本环境相适应的XDebug版本，放置于PHP目录，主要None-ThreadSafe版似乎是用来在CLI方式下使用的，一般不需要</p>
<p>2.修改php.ini文件，参考如下</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>Xdebug<span style="">&#93;</span></span>
<span style="color: #666666; font-style: italic;">;zend_extension_ts	= &quot;D:\server\php5\ext\php_xdebug-2.0.5-5.3-vc6.dll&quot;</span>
<span style="color: #666666; font-style: italic;">;发现在PHP5.3+Apache（CGI）方式下，似乎必须使用 zend_extension 加载才能成功</span>
<span style="color: #000099;">zend_extension</span>		<span style="color: #000066; font-weight:bold;">=</span> <span style="color: #933;">&quot;D:\server\php5\ext\php_xdebug-2.0.5-5.3-vc6-nts.dll&quot;</span>
&nbsp;
xdebug.auto_trace		<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> off		</span><span style="color: #666666; font-style: italic;">;开启自动跟踪</span>
&nbsp;
xdebug.remote_autostart		<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> off		</span><span style="color: #666666; font-style: italic;">;开启远程调试自动启动</span>
xdebug.remote_enable		<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> 1</span>
xdebug.remote_host		<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> 10.5.184.251</span>
xdebug.remote_port		<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> 9000</span>
<span style="color: #666666; font-style: italic;">;xdebug.remote_handler		= “dbgp”</span>
&nbsp;
xdebug.show_exception_trace	<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> On		</span><span style="color: #666666; font-style: italic;">;开启异常跟踪</span>
&nbsp;
xdebug.collect_vars		<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> On		</span><span style="color: #666666; font-style: italic;">;收集变量</span>
xdebug.collect_return		<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> On		</span><span style="color: #666666; font-style: italic;">;收集返回值</span>
xdebug.collect_params		<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> On		</span><span style="color: #666666; font-style: italic;">;收集参数</span></pre></div></div>

<p>注意：remote_host应该填写远程调试机的地址，而不是PHP服务器的地址，在Xdebug运行方式下，调试工具实际是调试过程的服务端，Xdebug会主动连接指定的remoete_host，从而建立调试通讯。所以要注意调试机的防火墙问题</p>
<p><br class="spacer_" /></p>
<p>3.配置调试工具，Eclipse就很好用，具体不说了，摸索下就可以了</p>
<p><span id="more-296"></span><br class="spacer_" /></p>
<p>4.Apaceh2下的CGI、FastCGI、Module方式都可以正常使用Xdebug</p>
<p>2009-07-07</p>
<p>5.最新发现在PHP5.3+Apache（CGI）方式下，似乎必须使用 zend_extension 加载才能成功，而不是Zend_extension_ts</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p>顺便放个我常用的PHP.ini的设定，你不需要逐个在PHP.INI里查找相应的行，再修改，只有把这些内容附加到PHP.INI文件后面，它会自动覆盖前面设置。</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">cgi.force_redirect		<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> 0</span>
cgi.fix_pathinfo		<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> 1</span>
fastcgi.impersonate		<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> 1</span><span style="color: #666666; font-style: italic;">; </span>
&nbsp;
<span style="color: #666666; font-style: italic;">;session.save_handler		= files</span>
<span style="color: #666666; font-style: italic;">;session.save_path		= /tmp</span>
session.use_cookies		<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> 1</span>
<span style="color: #666666; font-style: italic;">;session.use_only_cookies	= 1</span>
&nbsp;
<span style="color: #666666; font-style: italic;">; file_uploads			= On</span>
<span style="color: #666666; font-style: italic;">; upload_tmp_dir		=</span>
<span style="color: #666666; font-style: italic;">; upload_max_filesize		= 2M</span>
<span style="color: #666666; font-style: italic;">; post_max_size			= 8M</span>
<span style="color: #666666; font-style: italic;">; memory_limit			= 8M</span>
&nbsp;
<span style="color: #666666; font-style: italic;">; max_execution_time		= 30</span>
<span style="color: #666666; font-style: italic;">; max_input_time		= 60</span>
&nbsp;
<span style="color: #000099;">display_errors</span>			<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> on</span>
<span style="color: #666666; font-style: italic;">; error_reporting		=  E_ALL</span>
<span style="color: #000099;">log_errors</span>			<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> off</span>
<span style="color: #666666; font-style: italic;">; error_log			= d:\server\php5\logs\error.log</span>
&nbsp;
<span style="color: #666666; font-style: italic;">; mysql.connect_timeout		= 1</span>
<span style="color: #666666; font-style: italic;">; doc_root			= d:\wwwroot</span>
&nbsp;
<span style="color: #000099;">extension_dir</span>	<span style="color: #000066; font-weight:bold;">=</span> <span style="color: #933;">&quot;D:\server\php5\ext&quot;</span>
&nbsp;
<span style="color: #000099;">extension</span>	<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> php_mysql.dll</span>
<span style="color: #000099;">extension</span>	<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> php_mysqli.dll</span>
&nbsp;
<span style="color: #666666; font-style: italic;">;extension	= php_pdo.dll</span>
<span style="color: #000099;">extension</span>	<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> php_pdo_mysql.dll</span>
&nbsp;
<span style="color: #000099;">extension</span>	<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> php_mbstring.dll</span>
<span style="color: #000099;">extension</span>	<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> php_mcrypt.dll</span>
<span style="color: #000099;">extension</span>	<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> php_gd2.dll</span>
<span style="color: #000099;">extension</span>	<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> php_bz2.dll</span>
<span style="color: #000099;">extension</span>	<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> php_curl.dll</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://lee.kometo.com/archives/296/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UML关系定义的解析及思维导向图</title>
		<link>http://lee.kometo.com/archives/255</link>
		<comments>http://lee.kometo.com/archives/255#comments</comments>
		<pubDate>Mon, 05 Jan 2009 12:51:32 +0000</pubDate>
		<dc:creator>Emeric lee</dc:creator>
				<category><![CDATA[WEB应用开发]]></category>
		<category><![CDATA[深入PHP]]></category>
		<category><![CDATA[uml]]></category>
		<category><![CDATA[设计]]></category>

		<guid isPermaLink="false">http://lee.kometo.com/?p=255</guid>
		<description><![CDATA[对UML的关系定义一直有点感觉混乱，这是一天的学习总结，主要成果是下面的这张图，这张图没有按照一般的 Has a / Use a / Is a的3类法进行分类，而是把 Has a 作为了 Use a的一个子集来分析。因为没有看到任何其他参考资料使用了这种方式，所以这种方法未必完全准确，仅供参考。 引用解析 UML类图中5中关系的辨析(修订) 问题域、解域混合，编译时、运行时混合是这5种关系的特点。 关系 用词 问题域 解 域 编译时 运行时 Dependency uses a 短暂的或者对非业务类的（如工具类）依赖 作用域在方法内部的reference（可能是方法参数或方法内部声明的 reference ） 作用域在方法内部的reference（可能是方法参数或方法内部声明的 reference ） 短暂的 Association has a 相对固定的，对业务类的依赖 类属性 类属性 持续一定时间的 Aggregation owns but may share owns but may share 类属性 类属性 生命线可能相关联 Composition [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">对UML的关系定义一直有点感觉混乱，这是一天的学习总结，主要成果是下面的这张图，这张图没有按照一般的 <strong>Has a </strong>/ <strong>Use a</strong> / <strong>Is a</strong>的3类法进行分类，而是把<strong> Has a</strong> 作为了<strong> Use a</strong>的一个子集来分析。因为没有看到任何其他参考资料使用了这种方式，所以这种方法未必完全准确，仅供参考。</p>
<p><br class="spacer_" /></p>
<div id="attachment_259" class="wp-caption aligncenter" style="width: 510px"><a href="http://lee.kometo.com/wp-content/uploads/2009/01/classdiagram1.jpg"><img class="size-medium wp-image-259" title="UML" src="http://lee.kometo.com/wp-content/uploads/2009/01/classdiagram1-500x327.jpg" alt="UML关系解析思维导向图" width="500" height="327" /></a><p class="wp-caption-text">UML关系解析思维导向图</p></div>
<p><br class="spacer_" /></p>
<p><span id="more-255"></span></p>
<h4>引用解析</h4>
<blockquote><p><a href="http://blog.sina.com.cn/s/blog_4c4d6e740100buag.html" target="_blank">UML类图中5中关系的辨析(修订)</a></p>
<p>问题域、解域混合，编译时、运行时混合是这5种关系的特点。<br id="x514" /></p>
<table border="0" cellspacing="0" cellpadding="3">
<thead>
<tr id="ci05">
<td id="ali6" width="16%">关系<br id="znji" /></td>
<td id="ku3o" width="16%">用词<br id="drrt" /></td>
<td id="r-o2" width="16%">问题域<br id="pmls" /></td>
<td id="h2uh" width="16%">解 域<br id="lnr5" /></td>
<td id="mgxk" width="16%">编译时<br id="i1tn" /></td>
<td id="ifkl" width="16%">运行时<br id="abk3" /></td>
</tr>
</thead>
<tbody id="gn6t">
<tr id="fugi">
<td id="pw8q" width="16%">Dependency</td>
<td id="zy65" width="16%">uses a<br id="xia2" /></td>
<td id="smi7" width="16%">短暂的或者对非业务类的（如工具类）依赖<br id="rhnx" /></td>
<td id="g6n1" width="16%">作用域在方法内部的reference（可能是方法参数或方法内部声明的 reference ）</td>
<td id="idpi" width="16%">作用域在方法内部的reference（可能是方法参数或方法内部声明的 reference ）</td>
<td id="zwlx" width="16%">短暂的<br id="ky1s" /></td>
</tr>
<tr id="swos">
<td id="zh-g" width="16%">Association</td>
<td id="s76y" width="16%">has a<br id="fb-m" /></td>
<td id="jcxz" width="16%">相对固定的，对业务类的依赖<br id="z4iz" /></td>
<td id="ouu-" width="16%">类属性</td>
<td id="g333" width="16%">类属性</td>
<td id="io_p" width="16%">持续一定时间的<br id="mrc9" /></td>
</tr>
<tr id="m16m">
<td id="cze4" width="16%">Aggregation</td>
<td id="srd2" width="16%">owns but may share<br id="k-0q" /></td>
<td id="k8.i" width="16%">owns but may share</td>
<td id="chou" width="16%">类属性</td>
<td id="w6pv" width="16%">类属性</td>
<td id="z5l_" width="16%">生命线可能相关联<br id="dfpd" /></td>
</tr>
<tr id="ft9q">
<td id="k4bs" width="16%">Composition</td>
<td id="hm1y" width="16%">is part of<br id="utr8" /></td>
<td id="z9sv" width="16%">is part of</td>
<td id="ic26" width="16%">类属性</td>
<td id="k9yt" width="16%">类属性</td>
<td id="cts-" width="16%">生命线总是关联<br id="mo_8" /></td>
</tr>
<tr id="evfk">
<td id="kq9z" width="16%">Generalization</td>
<td id="yj35" width="16%">is a type of<br id="a-2c" /></td>
<td id="sd:n" width="16%">is a type of</td>
<td id="s-8d" width="16%">继承<br id="o_xb" /></td>
<td id="byr0" width="16%">继承<br id="ugne" /></td>
<td id="rp_o" width="16%"><br id="n2o4" /></td>
</tr>
</tbody>
</table>
</blockquote>
<h4>引用解析</h4>
<blockquote>
<div class="content">
<p><a href="http://www.koyoz.com/blog/?action=show&amp;id=108" target="_blank">UML系列学习之——关系定义</a></p>
<p>uml定义的关系主要有六种：依赖、类属、关联、实现、聚合和组合。下面对其定义和表示方法逐一说明。</p>
<p>依赖 （Dependency）：元素A的变化会影响元素B，但反之不成立，那么B和A的关系是依赖关系，B依赖A；类属关系和实现关系在语义上讲也是依赖关 系，但由于其有更特殊的用途，所以被单独描述。uml中用带箭头的虚线表示Dependency关系，箭头指向被依赖元素。</p>
<p>类属（Generalization）：通常所说的继承（特殊个体 is kind of 一般个体）关系，不必多解释了。uml中用带空心箭头的实线线表示Generalization关系，箭头指向一般个体。</p>
<p>实现（Realize）：元素A定义一个约定，元素B实现这个约定，则B和A的关系是Realize，B realize A。这个关系最常用于接口。uml中用空心空心箭头和虚线表示Realize关系，箭头指向定义约定的元素。</p>
<p>关联（Association）：元素间的结构化关系，是一种弱关系，被关联的元素间通常可以被独立的考虑。uml中用实线表示Dependency关系，箭头指向被依赖元素。</p>
<p>聚合（Aggregation）：关联关系的一种特例，表示部分和整体（整体 has a 部分）的关系。uml中用带空心菱形头的实线表示Aggregation关系，菱形头指向整体。</p>
<p><br class="spacer_" /></p>
<p>组 合（Composition）：组合是聚合关系的变种，表示元素间更强的组合关系。如果是组合关系，如果整体被破坏则个体一定会被破坏，而聚合的个体则可 能是被多个整体所共享的，不一定会随着某个整体的破坏而被破坏。uml中用带实心心菱形头的实线表示Composition关系，菱形头指向整体。</p>
<p><span style="color: #000000;"><strong>关系 </strong><span style="display: none;"> J+m1d\lBu </span><br />
 </span></p>
<p><span style="color: #000000;">后面的例子将针对某个具体目的来独立地展示各种关系。虽然语法无误，但这些例子可进一步精炼，在它们的有效范围内包括更多的语义。<span style="display: none;"> xE- �_Fv9 </span><span style="display: none;">l_\9J913 </span> <br />
 </span></p>
<p><span style="color: #000000;"><strong>依赖（Dependency） </strong><span style="display: none;"> &gt;  1=]. </span><br />
 </span></p>
<p><span style="color: #000000;">实体之间一个“使用”关系暗示一个实体的规范发生变化后，可能影响依赖于它的其他实例（<strong>图D</strong>）。 更具体地说，它可转换为对不在实例作用域内的一个类或对象的任何类型的引用。其中包括一个局部变量，对通过方法调用而获得的一个对象的引用（如下例所 示），或者对一个类的静态方法的引用（同时不存在那个类的一个实例）。也可利用“依赖”来表示包和包之间的关系。由于包中含有类，所以你可根据那些包中的 各个类之间的关系，表示出包和包的关系。</span></p>
<p style="text-align: center;"><span style="color: #000000;">图D</span></p>
<p style="text-align: center;"><span style="color: #000000;"><img style="width: 470px;" src="http://www.uml.org.cn/oobject/images/image004.gif" alt="" width="543" height="153" /></span></p>
<p><span style="color: #000000;"><span style="display: none;"> MB+a?u</span><strong>关联（Association）</strong><span style="display: none;"> Sb^o`~ Eh </span> <br />
 </span></p>
<p><span style="color: #000000;">实体之间的一个结构化关系表明对象是相互连接的。箭头是可选的，它用于指定导航能力。如果没有箭头，暗示是一种双向的导航能力。在Java中，关联（<strong>图E</strong>） 转换为一个实例作用域的变量，就像图E的“Java”区域所展示的代码那样。可为一个关联附加其他修饰符。多重性（Multiplicity）修饰符暗示 着实例之间的关系。在示范代码中，Employee可以有0个或更多的TimeCard对象。但是，每个TimeCard只从属于单独一个 Employee。</span></p>
<p style="text-align: center;"><span style="color: #000000;">图E</span></p>
<p style="text-align: center;"><span style="color: #000000;"><img style="width: 470px;" src="http://www.uml.org.cn/oobject/images/image005.gif" alt="" width="543" height="153" /></span></p>
<p><span style="color: #000000;"><strong>聚合（Aggregation） </strong><span style="display: none;"> {  a_&amp;L </span><br />
 </span></p>
<p><span style="color: #000000;">聚合（<strong>图F</strong>）是关联的一种形式，代表两个类之间的整体/局部关系。聚合暗示着整体在概念上处于比局部更高的一个级别，而关联暗示两个类在概念上位于相同的级别。聚合也转换成Java中的一个实例作用域变量。<span style="display: none;"> 7MIrrhk </span> <br />
 <span style="display: none;"> yC7lR#N8j0 </span> <br />
 关联和聚合的区别纯粹是概念上的，而且严格反映在语义上。聚合还暗示着实例图中不存在回路。换言之，只能是一种单向关系。</span></p>
<p style="text-align: center;"><span style="color: #000000;">图F</span></p>
<p style="text-align: center;"><span style="color: #000000;"><img style="width: 470px;" src="http://www.uml.org.cn/oobject/images/image006.gif" alt="" width="543" height="153" /></span></p>
<p align="left"><span style="color: #000000;"><span style="display: none;"> V`}u:t7r </span><span style="display: none;">xn	a</span><strong>合成（Composition） </strong><span style="display: none;"> {/i&amp;o </span><br />
 </span></p>
<p><span style="color: #000000;">合成 （<strong>图G</strong>） 是聚合的一种特殊形式，暗示“局部”在“整体”内部的生存期职责。合成也是非共享的。所以，虽然局部不一定要随整体的销毁而被销毁，但整体要么负责保持局 部的存活状态，要么负责将其销毁。局部不可与其他整体共享。但是，整体可将所有权转交给另一个对象，后者随即将承担生存期职责。</span></p>
<p><span style="color: #000000;">Employee和TimeCard的关系或许更适合表示成“合成”，而不是表示成“关联”。</span></p>
<p style="text-align: center;"><span style="color: #000000;">图G</span></p>
<p style="text-align: center;"><span style="color: #000000;"><img style="width: 470px;" src="http://www.uml.org.cn/oobject/images/image007.gif" alt="" width="543" height="153" /></span></p>
<p align="left"><span style="color: #000000;"><strong>泛化（Generalization） </strong><span style="display: none;"> _%	i!LyG </span><br />
 </span></p>
<p><span style="color: #000000;">泛化（<strong>图H</strong>）表示一个更泛化的元素和一个更具体的元素之间的关系。泛化是用于对继承进行建模的UML元素。在Java中，用<em>extends</em>关键字来直接表示这种关系。</span></p>
<p style="text-align: center;"><span style="color: #000000;">图H</span></p>
<p style="text-align: center;"><span style="color: #000000;"><img style="width: 470px;" src="http://www.uml.org.cn/oobject/images/image008.gif" alt="" width="543" height="153" /></span></p>
<p align="left"><strong><span style="color: #000000;"><span style="display: none;"> = oTj3+7 </span>实现（Realization）<span style="display: none;"> 3\K;y&gt;NK </span> <br />
 </span></strong></p>
<p><span style="color: #000000;">实例（<strong>图I</strong>）关系指定两个实体之间的一个合同。换言之，一个实体定义一个合同，而另一个实体保证履行该合同。对Java应用程序进行建模时，实现关系可直接用<em>implements</em>关键字来表示。</span></p>
<p style="text-align: center;"><span style="color: #000000;">图I</span></p>
<p style="text-align: center;"><span style="color: #000000;"><img style="width: 470px;" src="http://www.uml.org.cn/oobject/images/image009.gif" alt="" width="543" height="153" /></span></p>
</div>
</blockquote>
<h4>引用解析1</h4>
<blockquote><p><span style="font-family: Verdana;">常见的关系有：<strong>一般化关系（Generalization）</strong>，<strong>关联关系（Association）</strong>，聚合关系（Aggregation），合成关系（Composition），<strong>依赖关系（Dependency）</strong>。</span><span style="font-family: Verdana;"> 其中，聚合关系（Aggregation），合成关系（Composition）属于关联关系（Association）。</span></p>
<p><span style="font-family: Verdana;"> 一般关系表现为继承或实现关系(is a)，关联关系表现为变量(has a )，依赖关系表现为函数中的参数(use a)。</span></p>
<p><span style="font-family: Verdana;"> 一般化关系：表示为类与类之间的继承关系，接口与接口之间的继承，类对接口的实现关系。<br />
 表示方法： 用一个空心箭头＋实线，箭头指向父类。或空心箭头＋虚线，如果父类是接口。</span></p>
<p><span style="font-family: Verdana;"> 关联关系：类与类之间的联接，它使一个类知道另一个类的属性和方法。<br />
 表示方法：用 实线＋箭头， 箭头指向被使用的类。</span></p>
<p><span style="font-family: Verdana;"> 聚合关系：是关联关系的一种，是强的关联关系。聚合关系是整体和个体的关系。关联关系的两个类处于同一层次上，啊聚合关系两个类处于不同的层次，一个是整体，一个是部分。<br />
 表示方法：空心菱形＋实线＋箭头，箭头指向部分。</span></p>
<p><span style="font-family: Verdana;"> 合成关系：是关联关系的一种，是比聚合关系强的关系。它要求普通的聚合关系中代表整体的<a href="http://www.itisedu.com/phrase/200603090845215.html" target="_new"><span style="color: #0000ff;"><span style="text-decoration: underline;">对象</span></span></a>负责代表部分的对象的生命周期，合成关系不能共享。<br />
 表示方法：实心菱形＋实线＋箭头，</span></p>
<p><span style="font-family: Verdana;"> 依赖关系：是类与类之间的连接，表示一个类依赖于另一个类的定义。例如如果A依赖于B，则B体现为局部变量，方法的参数、或静态方法的调用。<br />
 表示方法：虚线＋箭头</span></p>
<p><br class="spacer_" /></p>
</blockquote>
<h4>引用解析2</h4>
<blockquote><p>1依赖：最弱的关系，A依赖B，就是说A的声明或者实现必须include B类的头文件。</p>
<p>2关联：在设计模式中叫做‘相识’。具有这种关系的两个类彼此没有拥有关系，并且互相之间没有创建和销毁的责任，只是存在某种调用关系。</p>
<p>3聚集：和关联比较想象，A聚集B的确切含义指：A类的某个成员是B类实例的指针，B类对象实例不是在构造A对象时隐含构造的，必须通过其它途径构造，但是在A类对象析构的时候必须析构B类对象实例。</p>
<p>4包含：实际上是值聚集，A包含B的确切含义指：A类的某个成员是B类的对象实例，A类构造时同时构造B类，A类析构时也必须析构B类。</p>
<p>5继承：较容易理解。</p>
</blockquote>
<h4>参考资料</h4>
<ul>
<li><a href="http://www.koyoz.com/blog/?action=show&amp;id=108" target="_blank">UML系列学习之——关系定义 <br />
 </a></li>
<li><a href="http://fluagen.blog.51cto.com/146595/46634" target="_blank">http://fluagen.blog.51cto.com/146595/46634</a></li>
<li><a href="http://www.koyoz.com/blog/?action=show&amp;id=108" target="_blank">UML系列学习之——关系定义</a></li>
</ul>
<p style="text-align: center;"><strong><span style="color: #ff6600;">这是一个Beta版的文档，随时可能会更新和完善。</span><br />
 </strong></p>
]]></content:encoded>
			<wfw:commentRss>http://lee.kometo.com/archives/255/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux入门-安装篇(Debian 服务器版)</title>
		<link>http://lee.kometo.com/archives/170</link>
		<comments>http://lee.kometo.com/archives/170#comments</comments>
		<pubDate>Wed, 29 Oct 2008 17:57:55 +0000</pubDate>
		<dc:creator>Emeric lee</dc:creator>
				<category><![CDATA[WEB应用开发]]></category>
		<category><![CDATA[深入PHP]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[安装]]></category>
		<category><![CDATA[服务器]]></category>
		<category><![CDATA[虚拟主机]]></category>

		<guid isPermaLink="false">http://lee.kometo.com/?p=170</guid>
		<description><![CDATA[本文描述了安装一个Linux（Debian）服务器的全过程，并附加了一些必要的参考文章，通篇以Debian为基础，以建立一个服务器（非桌面环境）为主要目的。 准备知识 这里列出的是一些经常使用到命令和功能，你不需要现在就完全理解，以后的配置工作随时会需要借助这些命令，粗略看一下，需要是再回来仔细看。 查找文件 #在/etc目录下查找init.d find /etc -name init.d #在当前目录下查找init* find . -name init* #在根目录下查找所有文件名以httpd开头的文件，并使用ls输出 find / -name 'httpd*' -ls #find还有很多更高级的功能，根据时间查找，指定查找层次等 &#160; ls *A* #查询当前目录下（含子目录）的匹配文件 (描述可能不准确) 进程及任务管理 ps / ps -A f #查看进程列表 kill ID #杀死指定进程ID jobs #当前任务列表 fg #把job提到前台 bg #把job放到后台运行 &#38;amp; #这个用在一个命令的最后，可以把这个命令放到后台执行 #快捷键 ctrl+z 把当前工作放到后台，并停止运行 参考：http://www.linuxeden.com/html/sysadmin/20080618/58737.html 修改主机名 hostname newname 主机的域信息在 /etc/hosts 重启,开关机 reboot [...]]]></description>
			<content:encoded><![CDATA[<p>本文描述了安装一个Linux（Debian）服务器的全过程，并附加了一些必要的参考文章，通篇以Debian为基础，以建立一个服务器（非桌面环境）为主要目的。</p>
<h3><span id="more-170"></span><br />
</h3>
<h3><strong>准备知识</strong></h3>
<p>这里列出的是一些经常使用到命令和功能，你不需要现在就完全理解，以后的配置工作随时会需要借助这些命令，粗略看一下，需要是再回来仔细看。</p>
<ul>
<li>查找文件

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#在/etc目录下查找init.d</span>
<span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #000000; font-weight: bold;">/</span>etc <span style="color: #660033;">-name</span> init.d
<span style="color: #666666; font-style: italic;">#在当前目录下查找init*</span>
<span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-name</span> init<span style="color: #000000; font-weight: bold;">*</span>
<span style="color: #666666; font-style: italic;">#在根目录下查找所有文件名以httpd开头的文件，并使用ls输出</span>
<span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">'httpd*'</span> <span style="color: #660033;">-ls</span>
<span style="color: #666666; font-style: italic;">#find还有很多更高级的功能，根据时间查找，指定查找层次等</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #000000; font-weight: bold;">*</span>A<span style="color: #000000; font-weight: bold;">*</span> <span style="color: #666666; font-style: italic;">#查询当前目录下（含子目录）的匹配文件 (描述可能不准确)</span></pre></div></div>

</li>
<li> </li>
<li>进程及任务管理

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ps</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #c20cb9; font-weight: bold;">ps</span> <span style="color: #660033;">-A</span>  f     <span style="color: #666666; font-style: italic;">#查看进程列表</span>
<span style="color: #c20cb9; font-weight: bold;">kill</span> ID           <span style="color: #666666; font-style: italic;">#杀死指定进程ID</span>
<span style="color: #7a0874; font-weight: bold;">jobs</span>              <span style="color: #666666; font-style: italic;">#当前任务列表</span>
<span style="color: #7a0874; font-weight: bold;">fg</span>                <span style="color: #666666; font-style: italic;">#把job提到前台</span>
<span style="color: #7a0874; font-weight: bold;">bg</span>                <span style="color: #666666; font-style: italic;">#把job放到后台运行</span>
<span style="color: #000000; font-weight: bold;">&amp;</span>amp;                 <span style="color: #666666; font-style: italic;">#这个用在一个命令的最后，可以把这个命令放到后台执行</span>
<span style="color: #666666; font-style: italic;">#快捷键 ctrl+z 把当前工作放到后台，并停止运行</span></pre></div></div>

<p>参考：http://www.linuxeden.com/html/sysadmin/20080618/58737.html</p>
</li>
<li>修改主机名<br />
 hostname newname<br />
 主机的域信息在 /etc/hosts</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<ul>
</ul>
</li>
<li>重启,开关机
<ul>
<li>reboot 重启 </li>
<li>poweroff 关机 </li>
<li>halt/shutdown</li>
<li>开关机的高级控制命令</li>
<li> /etc/init.d/下有一些控制脚本，可以用来控制一些服务启动，关闭等<br />
 调用这些脚本必须用全路径，类似：<br />
 /etc/rc.d/init.d/proftpd  restart<br />
 /etc/init.d/networking {start|stop|restart|force-reload} </li>
<li>重启一些指定服务</li>
</ul>
</li>
<li>其它
<ul>
<li>用好 TAB建，命令行下，很多情况它可以帮助你自动完成</li>
<li>Vim编辑器是必须掌握的，参看这里：<a rel="bookmark" href="../index.php/archives/176">Linux通用编辑器 VI VIM 入门</a></li>
</ul>
</li>
</ul>
<h3><strong>安装123</strong></h3>
<ul>
<li>启动盘启动安装<br />
 没啥好说的，从官网上随便下个好了，其它渠道获得的安装光盘也可以<br />
 如果安装机器可以连接外网的，网速快的直接用最小的MINI镜像（推荐，图形安装界面，很漂亮），这样直接使用最新软件源<br />
 如果安装机器网速慢或者没网络，找个大的镜像吧，并在下面的步骤中跳过 ”配置APT，扫描更新（可选）“</li>
<li>如果有网络，配置好网络，为下一步安装做准</li>
<li>主机名及域名，<br />
 如果你准备使用 www.abc.com这样的域名，建议使用www作为主机名，abc.com作为域名（实际可以随便填）<br />
 如果不准备使用域名，随便填</li>
<li>磁盘分区<br />
 没啥，按提示做好了，除非有特殊需要，全默认好了 </li>
<li>设置Root帐号密码，另外建立一个普通帐号</li>
<li>开始安装系统文件&#8230;&#8230;.<br />
 有点慢，5分钟吧</li>
<li>配置APT，扫描更新（可选）<br />
 不要选择里面的中国的镜像服务器，它比美国的还慢，还不稳定<br />
 推荐一个国内镜像http://www.anheng.com.cn/debian/ ，不在自动列表中，需要手动输入的，输入这个就行www.anheng.com.cn（测试时间&#8211;2008-10.29）<br />
 这里的进度条有时有问题，会长时间不动，其实是正在下载镜像中的资源，如果你不幸选择了一个较慢的镜像服务器，等待吧，也许要20分钟+～～<em>（出现这种情况建议你考虑重新开始安装以转换或放弃镜像服务器，否则接下来的的软件会让你崩溃）</em><br />
 如果有问题就直接跳过吧，以后可以在做的如果使用的是MINI镜像（&lt;10M）安装，这一步是必须的 </li>
<li>选择系统安装包<br />
 出现一个安装包列表，让你选择系统功能，如：桌面系统、WEB服务器、文件服务器、标准系统等，可以多选<br />
 这个列表的项目取决于你的安装镜像和方式，如果使用了上面的APT更新，可以获取最全的安装包<br />
 如果你是单机用户，桌面系统和标准系统是必选的<br />
 如果你是服务器用户，根据需要选择吧，也可以什么都不选，安装完再慢慢配<br />
 如果你要快速搭建一个WEB服务器选择 ”web服务器“ ，它会给你配置一个很稳定全面的WEB服务器</li>
<li>安装软件<br />
 安装上面选择安装包，和一些基本系统软件（即使你什么都没选）<br />
 速度取决于你选择的安装包和你的镜像来源 </li>
</ul>
<h3><strong>初始化系统123</strong></h3>
<p>这些工作是在系统安装完成后需要立即进行的工作，他们为你准备一个完善的系统环境，所有操作没有详细说明，可以参看最后的相关文章</p>
<p><strong><br />
 </strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">## 更新APT镜像源 ##</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> apt-spy
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/</span>sources.list <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/</span>sources.list.bak
apt-spy update
apt-spy <span style="color: #660033;">-d</span> stable-a Asia <span style="color: #660033;">-t</span> <span style="color: #000000;">10</span>
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> update
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> upgrade
&nbsp;
<span style="color: #666666; font-style: italic;">##安装几个基本软件 ##</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#安装SSH服务，安装完这一步就可以用SSH telnet到服务器管理了</span>
<span style="color: #666666; font-style: italic;">#另一个可能的命令是 apt-get install ssh</span>
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> openssh-server
&nbsp;
<span style="color: #666666; font-style: italic;">#安装完整版 VIM</span>
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">vim</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## 设定系统时间 ##</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>rcS     <span style="color: #666666; font-style: italic;">#设定硬件时钟的类型，修改UTC=no,重启后生效</span>
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> ntpdate  <span style="color: #666666; font-style: italic;">#安装网络时间同步服务</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#设定自动同步计划</span>
<span style="color: #666666; font-style: italic;">#添加这一行： */30 * * * * /usr/sbin/ntpdate pool.ntp.org</span>
crontab <span style="color: #660033;">-e</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## 设定系统提示符及bash环境 ##</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> ~
<span style="color: #c20cb9; font-weight: bold;">vim</span> .bashrc      <span style="color: #666666; font-style: italic;">#编辑.bashrc文件，去掉所有命令行的注释符，并可以配置promote格式</span>
<span style="color: #7a0874; font-weight: bold;">source</span> .bashrc   <span style="color: #666666; font-style: italic;">#重载bash，是配置生效</span></pre></div></div>

<p><br class="spacer_" /></p>
<p><strong>恭喜你！！完成了，到此一个可以工作的Linux系统就基本完成，后续的是一些进一步管理时需要深入的内容，你可以在需要时参考。</strong></p>
<hr style="width: 2px;" />
<p><br class="spacer_" /></p>
<h3><strong>安全，还是安全，</strong></h3>
<p style="padding-left: 30px;">作为服务器，这是首先应该考虑的，待完成。。。。。～</p>
<p style="padding-left: 30px;">参考：http://man.ddvip.com/os/debiansecuring-howto/ch-sec-services.zh-cn.html</p>
<h3><strong>网络配置</strong></h3>
<p>主要配置文件</p>
<p>/etc/network/interfaces</p>
<p>相关命令：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">hostname</span> newname  <span style="color: #666666; font-style: italic;">#修改主机名</span>
                  <span style="color: #666666; font-style: italic;">#主机的域信息在 /etc/hosts</span>
<span style="color: #c20cb9; font-weight: bold;">ifconfig</span>          <span style="color: #666666; font-style: italic;">#网络配置及显示</span>
route             <span style="color: #666666; font-style: italic;">#路由配置及显示</span>
ip                <span style="color: #666666; font-style: italic;">#IP配置</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#重启网络</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>networking <span style="color: #7a0874; font-weight: bold;">&#123;</span>start<span style="color: #000000; font-weight: bold;">|</span>stop<span style="color: #000000; font-weight: bold;">|</span>restart<span style="color: #000000; font-weight: bold;">|</span>force-reload<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p><br class="spacer_" /></p>
<h3><strong>其他软件简单介绍</strong><br />
</h3>
<ul>
<li><strong>ISPCP<br />
 </strong>参考 http://www.isp-control.net/documentation/start/installation/debian</li>
<li><strong>ProFTPD<br />
 </strong>参考 http://goto8848.net/2008/08/disable-proftpd-ipv6/<br />
 <strong>重启  /etc/rc.d/init.d/proftpd </strong></li>
</ul>
<ul>
</ul>
<p><br class="spacer_" /></p>
<p><strong>相关文章</strong></p>
<ul>
<li><a rel="bookmark" href="../index.php/archives/178">linux入门-系统时间设置篇</a></li>
<li><a rel="bookmark" href="../index.php/archives/185">linux入门-终端环境(bash)设置篇</a></li>
<li><a rel="bookmark" href="../index.php/archives/189">Linux入门-用户管理篇</a></li>
<li><a rel="bookmark" href="../index.php/archives/176">Linux入门-通用编辑器 VI VIM </a></li>
<li><a rel="bookmark" href="../index.php/archives/195">Linux入门-软件管理篇(APT)</a></li>
</ul>
<p><br class="spacer_" /></p>
<h3 class="codeblock">
<hr style="width: 1px;" />
<hr style="border: 1px solid #cccccc; width: 2px; color: #ffffff;" noshade="noshade" />
</h3>
<p><br class="spacer_" /></p>
]]></content:encoded>
			<wfw:commentRss>http://lee.kometo.com/archives/170/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Windows平台下Apache+PHP4+PHP5+FastCGI安装笔记</title>
		<link>http://lee.kometo.com/archives/97</link>
		<comments>http://lee.kometo.com/archives/97#comments</comments>
		<pubDate>Sun, 26 Oct 2008 21:05:48 +0000</pubDate>
		<dc:creator>Emeric lee</dc:creator>
				<category><![CDATA[WEB应用开发]]></category>
		<category><![CDATA[深入PHP]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[CGI]]></category>
		<category><![CDATA[fastcgi]]></category>
		<category><![CDATA[php4]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[共存]]></category>

		<guid isPermaLink="false">http://lee.kometo.com/?p=97</guid>
		<description><![CDATA[APACHE环境配置了一Apache+PHP4+PHP5+FastCGI环境，请注意：此配置实用的 CGI 运行方式，而没有使用常见的 Apache modules 方式。]]></description>
			<content:encoded><![CDATA[<h3>修正：2010.3</h3>
<p>1.PHP自5.3版起默认不在支持针对Windows的VC6编译版本，只提供VC9版本的，而APAche官方提供的Apache Windows编译包都是VC6的。所以我们需要使用第三方编译的VC9版本的Apache。</p>
<p>2.PHP 的 None Thread Safe 版本适用于CGI/FastCGI方式，而相应的Thread Safe版本适用于SAPI和Mod方式</p>
<p>3. <a href="http://www.apachelounge.com/download/">http://www.apachelounge.com/download/</a> 这里提供了大量适用于Windows的LAMP有关预编译包，包括VC9版本的Apache和FastCGI，这个网站也是PHP官方推荐的网站。</p>
<h3>原文</h3>
<h3>Go PHP5</h3>
<p>很多开发组织已经开始参与到 <a href="http://www.ooso.net/index.php/archives/348" target="_blank">Go PHP5</a> 的活动中来了，PHP官方也早已经声明于2007年底停止对PHP4的所有技术支持，看来PHP5/6的广泛应用已经是不可抗拒的浪潮了，仅仅是时间问题，而且时间不会太长。</p>
<h3>Apache+PHP+FastCGI</h3>
<p>对于目前的过渡阶段，很多开发者还是需要一个可以实现PHP4和PHP5共存的开发环境，这两天尝试在Windows下使用APACHE环境配置了一个PHP4和PHP5共存的环境，请注意：此配置使用 CGI 运行方式，而没有使用常见的 Apache modules 方式。我曾经尝试使用 Apache modules方式配置双PHP，但没有成功。</p>
<p>关键特性：</p>
<ol>
<li>Windows+Apache+PHP（Apache2.0下测试）</li>
<li>PHP4+PHP5共存</li>
<li>FastCGI</li>
</ol>
<p>以下是配置中用到的Apache Conf：</p>
<p><span id="more-97"></span></p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"># Apache加载PHP的配置，
# 直接附加到httpd.conf结尾
# 或使用 include 包含
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .php5
&nbsp;
ScriptAlias /php4/ <span style="color: #933;">&quot;D:/server/php4/&quot;</span>
Action php-script-<span style="">5</span> <span style="color: #933;">&quot;/php5/php-cgi.exe&quot;</span>
&nbsp;
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
&nbsp;
Action php-script-<span style="">4</span> <span style="color: #933;">&quot;/php4/php.exe&quot;</span>
&nbsp;
ScriptAlias /php5/ <span style="color: #933;">&quot;D:/server/php5/&quot;</span>
Action php-script-<span style="">5</span> <span style="color: #933;">&quot;/php5/php-cgi.exe&quot;</span>
&nbsp;
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
fcgid-<span style="">2.2</span>-w32.zip
&nbsp;
AddHandler php-script-<span style="">4</span> .php4
AddHandler php-script-<span style="">5</span> .php5
&nbsp;
#默认的使用的版本，可以在.htaccess文件中修改
AddHandler php-script-<span style="">4</span> .php</pre></div></div>

<p>简单说明下：PHP4和PHP5均使用手动安装包（不是Installer)，分别解压到 d:\server\php4 和 d:\server\php5。使用AddType命令指定扩展名对应关系：PHP4使用扩展名 &#8220;php&#8221;,PHP5使用扩展名“php5”。AddType可以再 .httaccess文件中使用，以实现修改不同目录的默认PHP版本。</p>
<p>PHP4包解压后需要把dlls和sapi目录下的所有文件拷贝到PHP4的根目录，既和PHP.exe放在一起。php.ini文件直接放在PHP4/5的根目录中即可(d:\server\php4 和 d:\server\php5)。注意要确保系统其它位置不要出现php.ini文件，否则可能会覆盖有效的配置。PHP本身的配置我就不说了，自己查资料吧。</p>
<h3>FastCGI</h3>
<p>CGI方式运行PHP最大的缺点是效率低，可以配合Fast-cgi使用，Conf文件修改如下，增加最后3行即可。</p>
<p>除了FastCGI另外还有一个fcgid也可以是参考</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"># Apache Conf 直接附加的配置文件末尾
LoadModule fastcgi_module modules/mod_fastcgi-2.4.2-AP20.dll
FastCgiServer <span style="color: #933;">&quot;D:/server/php4/php.exe&quot;</span> -processes <span style="">4</span>
# 如果PHP5的不能正常工作，可以用 #号 注释掉下一行，似乎这个平台下，PHP5+FastCGI还是有些问题
FastCgiServer <span style="color: #933;">&quot;D:/server/php5/php-cgi.exe&quot;</span> -processes <span style="">4</span>
&nbsp;
# 以下是未经验证的，仅供参考的配置语句
# FastCgiSuexec /usr/sbin/suexec
# FastCgiServer /var/www/igenus/php-cgi/php -processes <span style="">10</span>
# FastCgiConfig -singleThreshold <span style="">100</span> -killInterval <span style="">300</span> -autoUpdate -idle-timeout <span style="">240</span> -pass-header HTTP_AUTHORIZATION</pre></div></div>

<h3>相关PHP配置(可选的)</h3>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">; ==============================================================</span>
<span style="color: #666666; font-style: italic;">; 常用的PHP的附加配置，直接附加到PHP.ini文件的尾部</span>
<span style="color: #666666; font-style: italic;">; 另：CGI/FastCGI方式下运行的PHP，php.ini文件的最好位置就是放在PHP.exe所在的目录</span>
&nbsp;
<span style="color: #666666; font-style: italic;">; 这个目录必须设定好！！</span>
<span style="color: #000099;">extension_dir</span> <span style="color: #000066; font-weight:bold;">=</span> <span style="color: #933;">&quot;D:\server\php5\ext&quot;</span>
<span style="color: #000099;">extension</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">php_mysql.dll</span>
<span style="color: #666666; font-style: italic;">; extension=php_mysqli.dll</span>
<span style="color: #666666; font-style: italic;">; extension=php_pdo.dll</span>
<span style="color: #666666; font-style: italic;">; extension=php_pdo_mysql.dll</span>
<span style="color: #000099;">extension</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">php_mbstring.dll</span>
<span style="color: #000099;">extension</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">php_mcrypt.dll</span>
<span style="color: #000099;">extension</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">php_gd2.dll</span>
<span style="color: #000099;">extension</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">php_bz2.dll</span>
<span style="color: #000099;">extension</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">php_curl.dll</span>
&nbsp;
<span style="color: #666666; font-style: italic;">; doc_root = d:\wwwroot</span>
&nbsp;
<span style="color: #666666; font-style: italic;">; cgi.force_redirect = 0</span>
<span style="color: #666666; font-style: italic;">; cgi.fix_pathinfo=1</span>
<span style="color: #666666; font-style: italic;">; fastcgi.impersonate = 1; </span>
&nbsp;
<span style="color: #666666; font-style: italic;">; session.save_handler = files</span>
<span style="color: #666666; font-style: italic;">; session.save_path = /tmp</span>
<span style="color: #666666; font-style: italic;">; session.use_cookies = 1</span>
<span style="color: #666666; font-style: italic;">; session.use_only_cookies = 1</span>
&nbsp;
<span style="color: #666666; font-style: italic;">; file_uploads = On</span>
<span style="color: #666666; font-style: italic;">; upload_tmp_dir =</span>
<span style="color: #666666; font-style: italic;">; upload_max_filesize = 2M</span>
<span style="color: #666666; font-style: italic;">; post_max_size = 8M</span>
<span style="color: #666666; font-style: italic;">; memory_limit = 8M</span>
&nbsp;
<span style="color: #666666; font-style: italic;">; max_execution_time = 30</span>
<span style="color: #666666; font-style: italic;">; max_input_time = 60</span>
&nbsp;
<span style="color: #000099;">display_errors</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> on</span>
<span style="color: #000099;">error_reporting</span>  <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">  E_ALL</span>
<span style="color: #666666; font-style: italic;">; log_errors = off</span>
<span style="color: #666666; font-style: italic;">; error_log = d:\server\php5\logs\error.log</span>
&nbsp;
<span style="color: #666666; font-style: italic;">; mysql.connect_timeout = 1</span></pre></div></div>

<p>参考资料</p>
<ol>
<li>有关Fast CGI 请参阅：<a href="http://blogme.cn/node/6529">http://blogme.cn/node/6529</a> <a href="http://www.fastcgi.com/" target="_blank">http://www.fastcgi.com/</a></li>
<li> 有关Go PHP5 请参阅：<a href="http://www.ooso.net/index.php/archives/348">http://www.ooso.net/index.php/archives/348</a></li>
<li>这里还有篇比较罗嗦的指南，也可以看看：<a href="http://www.seji.cn/tech/infoView/Article_122.html">http://www.seji.cn/tech/infoView/Article_122.html</a></li>
<li>最后还有最应该看的：<a href="http://www.php.net/manual/en/install.windows.php">PHP安装手册</a></li>
</ol>
<blockquote><p>！！！经反复测试<strong>APACHE2.2+fastCGI+PHP5.*</strong>在windows平台下运行存在问题，使用以上配置无法工作，使用Apache2.0一切正常！！！<br />
相关错误提示(Apache&#8217;s errors.log)类似：<br />
<strong> terminated with exit with status &#8217;0&#8242;<br />
FastCGI: incomplete headers (0 bytes) received from server</strong><br />
我的测试版本是：PHP5.2.6 / FastCGI 2.4.6-AP22.dll /Apache 2.2 / Windows2003</p>
<p>表现为：</p>
<ul>
<li>在不启用FastCGI时，PHP5的反应非常迟钝，特别是在加载了Mysql扩展之后，很奇怪的现象！！</li>
<li>启用FastCGI时不能正常工作,而PHP4配合相同的设定确工作的很好<br />
相关的错误信息可以参看:</p>
<ul>
<li>FastCGI: server &#8220;D:/server/php5/php-cgi.exe&#8221; (pid 1708) terminated with exit with status &#8217;0&#8242;</li>
<li>(OS 109)管道已结束。  : FastCGI: comm with server &#8220;D:/server/php5/php-cgi.exe&#8221; aborted: GetOverlappedResult() failed</li>
<li>FastCGI: incomplete headers (0 bytes) received from server &#8220;D:/server/php5/php-cgi.exe&#8221;</li>
</ul>
</li>
</ul>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://lee.kometo.com/archives/97/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>重新审视PHP框架 CodeIgniter VS Zend</title>
		<link>http://lee.kometo.com/archives/117</link>
		<comments>http://lee.kometo.com/archives/117#comments</comments>
		<pubDate>Sat, 18 Oct 2008 15:24:27 +0000</pubDate>
		<dc:creator>Emeric lee</dc:creator>
				<category><![CDATA[WEB应用开发]]></category>
		<category><![CDATA[深入PHP]]></category>
		<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[框架]]></category>
		<category><![CDATA[比较]]></category>

		<guid isPermaLink="false">http://lee.kometo.com/index.php/archives/117</guid>
		<description><![CDATA[这篇文章是一个翻译，英文原文在 PHP frameworks revisited &#8211; CodeIgniter vs Zend，我的英文水平很一般，可能会有翻译不确切的地方(把握不大地方使用斜体进行了标志，并附带了英文原文)，请指正，并参看原文。 Emeric.Lee 2008.10.17 我们计划从头开始一个新项目，为此评估了一些PHP框架。我们的备选列表有CakePHP ， CodeIgniter ， Symfony和Zend 。 我们分别使用这4种框架编写了一个相同的小应用（一个简单的Wiki应用），希望我们能尽快选定一个最合适的。 声明：我会努力确保自己的客观性，虽然我是一个ColdeIginter的爱好者。我所工作的公司是Zend的合伙人（我们已经使用了Zend Platform 和 Zend Studio）。I can’t help factoring that in。 尽管一开始的计划是评估4个框架，但是这篇文章实际是CodeIgniter和Zend Framework的直接比较。在花费了几个小时研究了这4个框架后，我不得不把Symfony和CakePHP从名单中排除。理由如下： Learning curve 学习曲线 Symfony 和 CakePHP都有一个非常陡峭的学习曲线。CakePHP有严格的规则：数据表明此、文件位置、方法名和类名。Symfony使用 .yml 格式（需要学习，虽然它不是真的很难）来存储配置信息，并且大量的操作需要通过控制台(console)完成，创建数据表、数据模型和很多其它文件都需要使用命令行。 Strict ORM: 严格的ORM Symfony 和 CakePHP都有一个成熟的对象关系映射器(object-relational mappers &#124; ORM) ，提供对数据的访问，但是这一特性很难被禁用，除非作出大量的努力。这些ORM有着严格的规则和约定，它们必须被遵循。与之相反，Zend Framework 和 CodeIgniter 在是否使用Models和如何使用Models上非常灵活的。使用Models是可选的，虽然它们都有数据映射器（data mappers），但没有这些应用一样可以进行（开发编写）。应用的数据操作将是极其密集和精细（intensive ）的，我们不愿意受到选择的限制。 Flexibility: 灵活性 [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><em>这篇文章是一个翻译，英文原文在 <a id="dyow" title="PHP frameworks revisited - CodeIgniter vs Zend" href="http://www.avnetlabs.com/php/php-frameworks-revisited-codeigniter-vs-zend-framework" target="_blank">PHP frameworks revisited &#8211; CodeIgniter vs Zend</a>，我的英文水平很一般，可能会有翻译不确切的地方(把握不大地方使用斜体进行了标志，并附带了英文原文)，请指正，并参看原文。 Emeric.Lee 2008.10.17</em></p></blockquote>
<p>我们计划从头开始一个新项目，为此评估了一些PHP框架。我们的备选列表有CakePHP ， CodeIgniter ， Symfony和Zend 。 我们分别使用这4种框架编写了一个相同的小应用（一个简单的Wiki应用），希望我们能尽快选定一个最合适的。</p>
<p><strong>声明：</strong>我会努力确保自己的客观性，虽然我是一个ColdeIginter的爱好者。我所工作的公司是Zend的合伙人（我们已经使用了Zend Platform 和 Zend Studio）。<em>I can’t help factoring that in</em>。</p>
<p><span id="more-117"></span></p>
<p>尽管一开始的计划是评估4个框架，但是这篇文章实际是CodeIgniter和Zend Framework的直接比较。在花费了几个小时研究了这4个框架后，我不得不把Symfony和CakePHP从名单中排除。理由如下：</p>
<ul>
<li> Learning curve 学习曲线<br />
Symfony 和 CakePHP都有一个非常陡峭的学习曲线。CakePHP有严格的规则：数据表明此、文件位置、方法名和类名。Symfony使用 .yml 格式（需要学习，虽然它不是真的很难）来存储配置信息，并且大量的操作需要通过控制台(console)完成，创建数据表、数据模型和很多其它文件都需要使用命令行。</li>
<li> Strict ORM: 严格的ORM<br />
Symfony 和 CakePHP都有一个成熟的对象关系映射器(object-relational mappers | ORM) ，提供对数据的访问，但是这一特性很难被禁用，除非作出大量的努力。这些ORM有着严格的规则和约定，它们必须被遵循。与之相反，Zend Framework 和 CodeIgniter 在是否使用Models和如何使用Models上非常灵活的。使用Models是可选的，虽然它们都有数据映射器（data mappers），但没有这些应用一样可以进行（开发编写）。应用的数据操作将是极其密集和精细（intensive ）的，我们不愿意受到选择的限制。</li>
<li> Flexibility: 灵活性<br />
Zend Framework和CodeIgniter比其他两个框架更灵活。</li>
</ul>
<p><strong>最终对比</strong></p>
<p><strong></strong></p>
<div>
<table id="c1vf" class="zeroBorder" border="1" cellspacing="0" cellpadding="3" width="100%">
<tbody>
<tr>
<td style="background-color: #9fc5e8;" width="100"><strong><br />
</strong></td>
<td style="text-align: center; background-color: #9fc5e8;"><strong>CodeIgniter</strong></td>
<td style="text-align: center; background-color: #9fc5e8;"><strong>Zend Framework</strong></td>
</tr>
<tr>
<td style="background-color: #9fc5e8;" width="100"><strong>Set Up<br />
初始建立</strong></td>
<td>CodeIgniter很容易初始化。 复制框架的所有文件到网络服务器，这是一个不错的开始。 它的文件夹也很小-大约2 .1兆。从开始建立，5分钟后，我就可以显示出默认主页。</td>
<td>Zend Framework需要麻烦一些，它需要创建一个bootstrap文件，填写所有的初始化设置。比较之下，框架有点大-大约12.4MB。整个初始建立过程用来大约19分钟。</td>
</tr>
<tr>
<td style="background-color: #9fc5e8;" width="100"><strong>文档</strong></td>
<td>文档的结构和组织相当好，但是不如Zend Framework详细。CodeIgniter有论坛和Wike，有很多用户提交的代码。</td>
<td>Zend Framework有非常详细的文档，并且有很多示例。在我看来它的文档结构不如CodeIgniter，这可能是受到前面提到的细节和大量的可用的部件影响。ZF 也有一个Wiki，里面有少量的教程。</td>
</tr>
<tr>
<td style="background-color: #9fc5e8;" width="100"><strong>模板</strong></td>
<td>CodeIgniter包括一个模板分析器类，在我看来，它的作用是有限的，因为它不支持逻辑（例如，IF语句）。不管怎么说，CI建议在模板(view)中使用PHP标签。</td>
<td>ZF 包含了一个布局类，用于给整个站点或者应用提供一个通用布局（或者多个布局）。它直接在模板中使用PHP标签，它也提供了一个抽象的View类，可以使用第三方模板库进行扩展。</td>
</tr>
<tr>
<td style="background-color: #9fc5e8;" width="100"><strong>组件<br />
</strong></td>
<td>CI有很多库和帮助器来简化开发过程。尽管这些相比ZF还是显得少，但大体上，用法更简单(While it does have less of these than ZF, in the main, the usage of the CI variants is simpler)。</td>
<td>ZF有巨量的类和组件。它们有着很好的文档但使用起来要比CI的稍微复杂一些。</td>
</tr>
<tr>
<td style="background-color: #9fc5e8;" width="100"><strong>数据访问</strong></td>
<td>CI有一个用于处理数据库连接的数据库类。这个类可以使用标准的SQL查询，使用标准的PHP方式进行创建、检索、更新和删除。<br />
CI也提供了一个Active Record类，这是一个修改版的活动记录模式（Active Record Database Pattern）。这一模式可以让你使用更少的代码进行数据检索、插入和更新。某些情况下仅仅需要1到2行代码就可以进行一个数据操作。<br />
除了简化，活动记录的一个主要好处是：它可以创建一个不依赖数据库的应用，因为查询语句是由不同的数据库适配器生成的。它还考虑了查询的安全性，系统会自动对变量进行escape。</td>
<td>Zend_Db 和它的相关类为ZF提供了一个简单SQL数据库接口。它接收标准SQL查询但是简化了获取查询结果的过程。它还包括了一个ORM，使用Table Data Gateway 和 Row Data Gateway。它们分别把数据表和数据行包装成对象，并且极大的提高了开发速度。<br />
缺点是，和CI使用的修改版的active record pattern（没有广泛的使用对象）相比，有轻微的性能损失。<br />
<em>Zend_Db 还可以处理表关系。（Zend_Db can also model table relationships in PHP classes making database joins a breeze.）</em></td>
</tr>
<tr>
<td style="background-color: #9fc5e8;" width="100"><strong>灵活性</strong></td>
<td>CI非常灵活，几乎所有的默认设置都可以修改。</td>
<td>ZF其实一个类的简单集合，<br />
所有的文件和目录可以被放置到任何位置，只要这些位置被加入到了bootstrap文件。</td>
</tr>
<tr>
<td style="background-color: #9fc5e8;" width="100"><strong>验证</strong></td>
<td>在CI中数据验证是由一个验证类处理的。一些规则被定义并赋予验证对象（object），验证对象自动的验证从URL或者表单提交的数据。程序员可以决定如何处理这些获取。验证类还可以帮助自动的给指定字段设置错误信息。</td>
<td>Zend_Validate 提供了一套常用的验证器。它还提供了一个简单的验证器连接机制，多个验证器可以按指定的顺序应用到单一数据上（datum ）。<em>在ZF中，每个验证器都是一个不同的类，类被添加到数据（就像过滤器），而不是像CI一样，数据被传入类。In ZF, each validator is a separate class and the class is added to the data (like a filter) rather than the data being passed into the class like it is in CodeIgniter.</em></td>
</tr>
<tr>
<td style="background-color: #9fc5e8;" width="100"><strong>表单</strong></td>
<td>CI中的Form Helper文件包含一些函数，用于帮助操作表单。它的作用是生成表单字段，但是书写HTML仍然是无法避免的。</td>
<td>Zend_Form 简化了表单的创建和处理。它处理元素过滤、验证、escaping data、表单生成（rendering)。使用Zend_Form，ZF可以使用PHP完全的包装一个表单，包括标签、验证、错误信息。</td>
</tr>
<tr>
<td style="background-color: #9fc5e8;" width="100"><strong>性能</strong></td>
<td>CI大约有ZF的2倍性能</td>
<td>ZF大约比CI慢一半</td>
</tr>
<tr>
<td style="background-color: #9fc5e8;" width="100"><strong>测试</strong></td>
<td>CI有一个单元测试类，但是它鼓励混合测试代码和真实代码，我不建议这样。<em>也许可以使用第三方的扩展用于简单测试。A third-party extension for SimpleTest is available though。<br />
</em>和CI的类一起使用PHPUnit也是可以的。</td>
<td>ZF没有内置的测试类，但是它的核心类使用PHPUnit作为测试框架，<em>这可以被扩展来包含所有的附加类 this can be extended to include any additional classes。</em>在ZF中使用 SimpleTest 也是可行的。</td>
</tr>
<tr>
<td style="background-color: #9fc5e8;" width="100"><strong>国际化</strong></td>
<td>NO</td>
<td>YES</td>
</tr>
<tr>
<td style="background-color: #9fc5e8;" width="100"><strong>授权</strong></td>
<td>BSD-style</td>
<td>New BSD</td>
</tr>
</tbody>
</table>
</div>
<p><strong>综述 </strong></p>
<p>我对性能上差异非常惊讶（通过使用apachebench 衡量载入一个从数据库检索4条记录的主页）。<em>我期望使用单纯PHP5的高效可以弥补ZF的额外大小。 I expected the efficiency of using PHP5 only features to make up for the extra size of the Zend framework.</em></p>
<p>Zend Framework的优势包括：</p>
<ul>
<li> “官方的PHP框架” 。</li>
<li> 我工作的公司是Zend的“伙伴” 。</li>
<li> 全功能布局和模板系统。</li>
<li> 大量的类和组件。</li>
<li> 极其灵活。</li>
<li> 更先进的数据库库</li>
<li> 更先进的验证库。</li>
<li> 国际支持</li>
</ul>
<p>CodeIgniter优势包括：</p>
<ul>
<li> 非常易于安装。</li>
<li> 比Zend Framework更低的学习曲线</li>
<li> 更易访问的文档</li>
<li> 简明语法 &#8211; ZendF ramework的语法有些冗长</li>
<li> 速度比ZF搞100 ％</li>
</ul>
<p><strong>在我来看没有任何明确的“赢家”，是的，我们还是没能作出选择。</strong></p>
<blockquote><p>译者注：原文作者在一开始就声明了自己是一个CI爱好者，因此我们可以基本肯定作者对CI理解肯定要比ZF深入，因此在初 次使用ZF构建测试应用是，我们可以设想作者对ZF优化和精细操控肯定不如对CI的，这应该会带来一些性能上差异。但是基于对ZF理解，我认为ZF的性能 应该是低于CI的，它的结构太严谨了，但应该不会有2倍的差距的！</p></blockquote>
<blockquote><p>这是2篇相关联的文章</p>
<ul>
<li><a rel="bookmark" href="../index.php/archives/117">重新审视PHP框架 CodeIgniter VS Zend</a></li>
<li><a rel="bookmark" href="../index.php/archives/123">PHP框架基准测试比较（这里有关于上述性能比较的详细测试）</a></li>
</ul>
</blockquote>
<blockquote><p><ins datetime="2008-9-19">这是英文原文后附带的一篇评论，似乎是由ZF的开发人员发，直接转过来了，懒得翻译了&#8230;</ins></p>
<p>Great comparison, and I’m glad that you’re considering using ZF. A few points, however:</p>
<p>1) Set Up: We really don’t optimize for small size of the distribution archive. In fact, if you take a look in there, you’ll see about half of it is locale data in XML format. We plan to start building and releasing a ‘lean and mean’ distribution soon that I suspect will be no more than a few MB’s. But please keep in mind, if this is any measure of ‘bloat’, it is simply a reflection of how much disk space the framework takes up and possibly how many components we make available. Because all the components are loosely coupled, you can remove the components you’re not using to retrieve disk space as needed. Then again, I can’t remember the last time that I bothered to put any time in to paring down server-side software to save a few MB’s of disk space. <img class="wp-smiley" src="http://www.avnetlabs.com/wp-includes/images/smilies/icon_wink.gif" alt=";)" /></p>
<p>2) Documentation: How could we organize it better? I’m currently going through all the chapters to fix any spelling, grammar, technical, and style issues I see. I know that a few of the chapters are pretty rough English-wise since they were written by non-native speakers. Please send any feedback to <a href="mailto:wil@zend">wil@zend</a> so I can keep it in mind while I’m doing this.</p>
<p>3) Database Access: Is there any noticeable performance penalty in using our more object-intensive approach when you take the heavy hit of a database query in to account? If so, let me know ASAP so I can profile and fix it. <img class="wp-smiley" src="http://www.avnetlabs.com/wp-includes/images/smilies/icon_smile.gif" alt=":)" /></p>
<p>4) Validation: I don’t understand what you mean by “the class is added to the data (like a filter) rather than the data being passed into the class like it is in CodeIgniter”. That description doesn’t match my understanding of Zend_Validate usage at all.</p>
<p>5) Performance: We get a lot of performance comparisons between ZF and other frameworks, but I have to say this is definitely one of the most generalized comparisons and sweeping conclusions I’ve ever seen between 2 complex sets of code. <img class="wp-smiley" src="http://www.avnetlabs.com/wp-includes/images/smilies/icon_wink.gif" alt=";)" /> You provide a basic description of your test case below, and honestly it doesn’t sound anything like a real world application. I hope you’re not taking the database calls themselves in to account, but I would *strongly* discourage making any kinds of conclusions based on such a simple comparison.<br />
Performance benchmarks are hard. I’m not saying that ZF is slower or faster than CI in any definitive way; I don’t have the numbers from a sound experiment to back up such an assertion. But we do plan a full performance audit of ZF with comparisons against other major frameworks (CI may or may not be benchmarked) with full disclosure of methods. This will require about 2 developer months to finish with the direct help of our ZF architect and one PHP core developer. *That’s* how serious I am when I say it takes a lot to come up with conclusions about performance for complex pieces of software.<br />
If you need some gauge before then, consider writing a small front-to-back part of your application using all the major features you expect to use in the final application on both frameworks and performance test it for major use cases. <strong>If you don’t have the time for that, then just let me mention now that ZF 1.6 and the quickly following 1.7 will both include significant performance enhancements</strong>. <img class="wp-smiley" src="http://www.avnetlabs.com/wp-includes/images/smilies/icon_smile.gif" alt=":)" /></p>
<p>6) Testing: Matthew, our ZF architect, has just completed a controller unit test harness that make testing controllers a piece of cake using PHPUnit. He’s mocked sessions, request and response objects, and- well- you might want to just check it out in the incubator: <a rel="nofollow" href="http://framework.zend.com/code/browse/Standard_Incubator/library/Zend/Test/PHPUnit/">http://framework.zend.com/code/browse/Standard_Incubator/library/Zend/Test/PHPUnit/</a></p>
<p>7) General: Fortunately, you don’t necessarily have to chose one or the other, anyways! ZF components will work just as well within CI. It’s used very commonly alongside all PHP frameworks out there.</p>
<p>In any case, best of luck with whatever framework(s) you’re using!</p>
<p><strong>,Wil</strong></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://lee.kometo.com/archives/117/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Framework 框架典型初始化过程的效率测试与分析</title>
		<link>http://lee.kometo.com/archives/106</link>
		<comments>http://lee.kometo.com/archives/106#comments</comments>
		<pubDate>Thu, 19 Jun 2008 08:06:56 +0000</pubDate>
		<dc:creator>Emeric lee</dc:creator>
				<category><![CDATA[IT前沿]]></category>
		<category><![CDATA[WEB应用开发]]></category>
		<category><![CDATA[深入PHP]]></category>
		<category><![CDATA[TFB]]></category>
		<category><![CDATA[Webserver Stress]]></category>
		<category><![CDATA[Zend Framwork]]></category>
		<category><![CDATA[效率]]></category>
		<category><![CDATA[测试]]></category>

		<guid isPermaLink="false">http://lee.kometo.com/index.php/archives/106</guid>
		<description><![CDATA[在一个典型的PHP服务器环境下运行一个典型的Zend Framework，并分段逐步分析性能消耗情况]]></description>
			<content:encoded><![CDATA[<h3>测试目的</h3>
<p >在一个典型的PHP服务器环境下运行一个典型的Zend Framework，并分段逐步分析性能消耗情况</p>
<p><span id="more-106"></span></p>
<h3>测试环境：</h3>
<p style="padding-left: 30px;">Apache/2.0.55 (Win32) mod_fastcgi/2.4.2<br id="w27y" /> PHP Version 5.2.5 （无Zend Optimizer等加速模块）<br id="w27y0" /> Windows 2003 NT 5.2 build 3790<br id="w27y1" /> Cpu： intel Xeon 3.0G<br id="nv.o" /> 内存： 1G</p>
<h3 id="h4701">主要测试伪代码</h3>
<div id="ntwg" style="margin-left: 40px;"><span style="color: #0000ff;"><?php</span><br id="h4702" style="color: #0000ff;" /> <span style="color: #0000ff;"> step 1:    set_include_path()<br id="aur5" /> step 2:</span><span style="color: #0000ff;"> require Zend_Loder</span><br id="p9n:" style="color: #0000ff;" /> <span style="color: #0000ff;"> step 3:    registerAutoload</span><br id="p9n:0" style="color: #0000ff;" /> <span style="color: #0000ff;"> step 4:    load config &amp; create db adapter<br id="r-e_" /> step 5:</span><span style="color: #0000ff;"> init zend layout<br id="r-e_0" /> step 6:</span><span style="color: #0000ff;"> init zend auth<br id="r-e_1" /> step 7:</span><span style="color: #0000ff;"> init Zend front controller &amp; Dispath</span><br id="av1y1" style="color: #0000ff;" /> <span style="color: #0000ff;">?></span><br id="ntwg3" /></div>
<h3>测试方法和主要测试指标</h3>
<p style="padding-left: 30px;"><span style="color: #000000;"> 1、</span><strong id="y1mw" style="color: #000000;">PHP Core Time（PCT）：</strong><span style="color: #000000;">服务器端使用<span style="color: #0000ff;"> vsprintf(&#8216;%d.%06d&#8217;, gettimeofday()) </span>进行微秒级的计时，并输出总的PHP代码运行时间。</span><br id="o:nr" style="color: #000000;" /> <span style="color: #000000;"> 2、客户端使用 Webserver Stress Tool 进行客户端的压力测试和访问记时，主要评估两个指标：</span><br id="d2md" style="color: #000000;" /> <span style="color: #000000;"> Average Time to First Byte （TFB）：首字节的接收时间</span><br id="l6no" style="color: #000000;" /> <span style="color: #000000;">Average Click Time （CT）：模拟点击完成时间，既页面从点击请求开始到下载完成的时间<br id="ttka" /> 3、</span><span style="color: #000000;"> Webserver Stress Tool测试模拟两种情况<br id="zlds" /> 低负载：单用户，间隔2秒点击一次页面<br id="tu9g" /> 高负载：30个用户，每人间隔2秒点击一次页面，相当于每秒动态页面访问</span><span style="color: #000000;">（DPV）</span><span style="color: #000000;">5-10次<br id="s67g" /> </span></p>
<h3 id="zp8z">测试综合结果</h3>
<p><!--more--></p>
<div id="tq9-">
<table style="width: 80%;" border="1" cellspacing="0" cellpadding="4">
<tbody id="tq9-0">
<tr id="tq9-1">
<td id="tq9-2" style="background-color: #0000ff; color: #ffffff;" rowspan="2"><span style="font-size: small;"><br id="tq9-3" /> </span><span style="font-size: small;"><br id="tq9-12" /> </span></td>
<td id="ex1c" style="background-color: #741b47; color: #ffffff;" rowspan="2" valign="top"><span style="font-size: small;"><br id="ex1c0" /> </span><span style="font-size: small;">PCT<br id="ex1c6" /> </span></td>
<td id="ex1c1" style="background-color: #00ff00; color: #000000; text-align: center;" colspan="2" valign="top"><span style="font-size: small;">低负载</span><span style="font-size: small;"><br id="ex1c4" /> </span></td>
<td id="tx6q" style="background-color: #ff0000; color: #ffffff; text-align: center;" colspan="2" valign="top"><span style="font-size: small;">高负载</span><span style="font-size: small;"><br id="tx6q2" /> </span></td>
<td id="t7-:" style="background-color: #ffd966;" valign="top"><span style="font-size: small;"><br id="t7-:0" /> </span></td>
</tr>
<tr id="tq9-10">
<td id="ex1c7" style="background-color: #00ff00; color: #000000; text-align: right;" valign="top"><span style="font-size: small;">TFB<br id="ex1c8" /> </span></td>
<td id="ex1c9" style="background-color: #00ff00; color: #000000; text-align: right;" valign="top"><span style="font-size: small;">CT<br id="ex1c10" /> </span></td>
<td id="tx6q3" style="background-color: #ff0000; color: #ffffff; text-align: right;" valign="top"><span style="font-size: small;">TFB<br id="tx6q4" /> </span></td>
<td id="tx6q5" style="background-color: #ff0000; color: #ffffff; text-align: right;"><span style="font-size: small;">CT<br id="tx6q6" /> </span></td>
<td id="t7-:1" style="background-color: #ffd966; text-align: center;" valign="top"><span style="font-size: small;">执行代码（增量）<br id="t7-:2" /> </span></td>
</tr>
<tr id="tq9-19">
<td id="tq9-20" style="background-color: #0000ff; color: #ffffff;"><span style="font-size: small;">Step 1<br id="tq9-21" /> </span></td>
<td id="ex1c11" style="background-color: #741b47; color: #ffffff; text-align: right;" valign="top"><strong id="l08f14"><span style="font-size: small;">0.05<br id="ex1c12" /> </span></strong></td>
<td id="ex1c13" style="background-color: #00ff00; text-align: right;" valign="top"><strong id="l08f16"><span style="font-size: small;">89<br id="ex1c14" /> </span></strong></td>
<td id="ex1c15" style="background-color: #00ff00; text-align: right;" valign="top"><strong id="l08f18"><span style="font-size: small;">1054<br id="ex1c16" /> </span></strong></td>
<td id="tx6q7" style="background-color: #ff0000; color: #ffffff; text-align: right;" valign="top"><strong id="l08f20"><span style="font-size: small;">168<br id="tx6q8" /> </span></strong></td>
<td id="tx6q9" style="background-color: #ff0000; color: #ffffff; text-align: right;"><strong id="l08f22"><span style="font-size: small;">246<br id="tx6q10" /> </span></strong></td>
<td id="t7-:3" style="text-align: left;" valign="top"><span style="font-size: small;"><span style="color: #0000ff;">set_include_path()</span></span></td>
</tr>
<tr id="tq9-28">
<td id="tq9-29" style="background-color: #0000ff; color: #ffffff;"><span style="font-size: small;">Step 2<br id="tq9-30" /> </span></td>
<td id="ex1c17" style="background-color: #741b47; color: #ffffff; text-align: right;" valign="top"><strong id="l08f26"><span style="font-size: small;">1.9<br id="ex1c18" /> </span></strong></td>
<td id="ex1c19" style="background-color: #00ff00; text-align: right;" valign="top"><strong id="l08f28"><span style="font-size: small;">133<br id="ex1c20" /> </span></strong></td>
<td id="ex1c21" style="background-color: #00ff00; text-align: right;" valign="top"><strong id="l08f30"><span style="font-size: small;">847<br id="ex1c22" /> </span></strong></td>
<td id="tx6q11" style="background-color: #ff0000; color: #ffffff; text-align: right;" valign="top"><strong id="l08f32"><span style="font-size: small;">148<br id="tx6q12" /> </span></strong></td>
<td id="tx6q13" style="background-color: #ff0000; color: #ffffff; text-align: right;"><strong id="l08f34"><span style="font-size: small;">211<br id="tx6q14" /> </span></strong></td>
<td id="t7-:5" style="text-align: left;" valign="top"><span style="font-size: small;"><span style="color: #0000ff;">require Zend_Loder</span></span></td>
</tr>
<tr id="tq9-37">
<td id="tq9-38" style="background-color: #0000ff; color: #ffffff;"><span style="font-size: small;">Step 3<br id="mevb" /> </span></td>
<td id="ex1c23" style="background-color: #741b47; color: #ffffff; text-align: right;" valign="top"><strong id="l08f38"><span style="font-size: small;">2.7<br id="ex1c24" /> </span></strong></td>
<td id="ex1c25" style="background-color: #00ff00; text-align: right;" valign="top"><strong id="l08f40"><span style="font-size: small;">144<br id="ex1c26" /> </span></strong></td>
<td id="ex1c27" style="background-color: #00ff00; text-align: right;" valign="top"><strong id="l08f42"><span style="font-size: small;">1010<br id="ex1c28" /> </span></strong></td>
<td id="tx6q15" style="background-color: #ff0000; color: #ffffff; text-align: right;" valign="top"><strong id="l08f44"><span style="font-size: small;">229<br id="tx6q16" /> </span></strong></td>
<td id="tx6q17" style="background-color: #ff0000; color: #ffffff; text-align: right;"><strong id="l08f46"><span style="font-size: small;">299<br id="tx6q18" /> </span></strong></td>
<td id="t7-:7" style="text-align: left;" valign="top"><span style="font-size: small;"><span style="color: #0000ff;">registerAutoload</span></span></td>
</tr>
<tr id="tq9-46">
<td id="tq9-47" style="background-color: #0000ff; color: #ffffff;"><span style="font-size: small;">Step 4<br id="mevb0" /> </span></td>
<td id="ex1c29" style="background-color: #741b47; color: #ffffff; text-align: right;" valign="top"><strong id="l08f50"><span style="font-size: small;">70<br id="ex1c30" /> </span></strong></td>
<td id="ex1c31" style="background-color: #00ff00; text-align: right;" valign="top"><strong id="l08f52"><span style="font-size: small;">166<br id="ex1c32" /> </span></strong></td>
<td id="ex1c33" style="background-color: #00ff00; text-align: right;" valign="top"><strong id="l08f54"><span style="font-size: small;">842<br id="ex1c34" /> </span></strong></td>
<td id="tx6q19" style="background-color: #ff0000; color: #ffffff; text-align: right;" valign="top"><strong id="l08f56"><span style="font-size: small;">249<br id="tx6q20" /> </span></strong></td>
<td id="tx6q21" style="background-color: #ff0000; color: #ffffff; text-align: right;"><strong id="l08f58"><span style="font-size: small;">337<br id="tx6q22" /> </span></strong></td>
<td id="t7-:9" style="text-align: left;" valign="top"><span style="font-size: small;"><span style="color: #0000ff;">load config &amp; create db adapter</span></span></td>
</tr>
<tr id="tq9-55">
<td id="tq9-56" style="background-color: #0000ff; color: #ffffff;"><span style="font-size: small;">Step 5<br id="mevb1" /> </span></td>
<td id="ex1c35" style="background-color: #741b47; color: #ffffff; text-align: right;" valign="top"><strong id="l08f62"><span style="font-size: small;">150<br id="ex1c36" /> </span></strong></td>
<td id="ex1c37" style="background-color: #00ff00; text-align: right;" valign="top"><strong id="l08f64"><span style="font-size: small;">229<br id="ex1c38" /> </span></strong></td>
<td id="ex1c39" style="background-color: #00ff00; text-align: right;" valign="top"><strong id="l08f66"><span style="font-size: small;">1053<br id="ex1c40" /> </span></strong></td>
<td id="tx6q23" style="background-color: #ff0000; color: #ffffff; text-align: right;" valign="top"><strong id="l08f68"><span style="font-size: small;">1544<br id="tx6q24" /> </span></strong></td>
<td id="tx6q25" style="background-color: #ff0000; color: #ffffff; text-align: right;"><strong id="l08f70"><span style="font-size: small;">1692<br id="tx6q26" /> </span></strong></td>
<td id="t7-:11" style="text-align: left;" valign="top"><span style="font-size: small;"><span style="color: #0000ff;">init zend layout</span></span></td>
</tr>
<tr id="tq9-64">
<td id="tq9-65" style="background-color: #0000ff; color: #ffffff;"><span style="font-size: small;">Step 6<br id="mevb2" /> </span></td>
<td id="ex1c41" style="background-color: #741b47; color: #ffffff; text-align: right;" valign="top"><strong id="l08f74"><span style="font-size: small;">150<br id="ex1c42" /> </span></strong></td>
<td id="ex1c43" style="background-color: #00ff00; text-align: right;" valign="top"><strong id="l08f76"><span style="font-size: small;">254<br id="ex1c44" /> </span></strong></td>
<td id="ex1c45" style="background-color: #00ff00; text-align: right;" valign="top"><strong id="l08f78"><span style="font-size: small;">741<br id="ex1c46" /> </span></strong></td>
<td id="tx6q27" style="background-color: #ff0000; color: #ffffff; text-align: right;" valign="top"><strong id="l08f80"><span style="font-size: small;">2430<br id="tx6q28" /> </span></strong></td>
<td id="tx6q29" style="background-color: #ff0000; color: #ffffff; text-align: right;"><strong id="l08f82"><span style="font-size: small;">2552<br id="tx6q30" /> </span></strong></td>
<td id="t7-:13" style="text-align: left;" valign="top"><span style="font-size: small;"><span style="color: #0000ff;">init zend auth</span></span></td>
</tr>
<tr id="tq9-73">
<td id="tq9-74" style="background-color: #0000ff; color: #ffffff;"><span style="font-size: small;">Step 7<br id="mevb3" /> </span></td>
<td id="ex1c47" style="background-color: #741b47; color: #ffffff; text-align: right;" valign="top"><strong id="l08f86"><span style="font-size: small;">300<br id="ex1c48" /> </span></strong></td>
<td id="ex1c49" style="background-color: #00ff00; text-align: right;" valign="top"><strong id="l08f88"><span style="font-size: small;">382<br id="ex1c50" /> </span></strong></td>
<td id="ex1c51" style="background-color: #00ff00; text-align: right;" valign="top"><strong id="l08f90"><span style="font-size: small;">1053<br id="ex1c52" /> </span></strong></td>
<td id="tx6q31" style="background-color: #ff0000; color: #ffffff; text-align: right;" valign="top"><strong id="l08f92"><span style="font-size: small;">5054<br id="tx6q32" /> </span></strong></td>
<td id="tx6q33" style="background-color: #ff0000; color: #ffffff; text-align: right;"><strong id="l08f94"><span style="font-size: small;">5404<br id="tx6q34" /> </span></strong></td>
<td id="t7-:15" valign="top"><span style="font-size: small;"><span style="color: #0000ff;">init Zend front controller &amp; <strong id="xw6v"><span style="color: #ff0000;">Dispath</span></strong></span></span></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td style="text-align: right;">单位：ms</td>
</tr>
</tbody>
</table>
<h3>测试结果综合分析</h3>
<p style="text-align: left; padding-left: 30px;">1、ZF的典型环境初始化的基本消耗还是比较大的，测试代码的最终结果仅仅是使用的ZF标准MVC架构输出了一个Hello，我们可以看到，它的PCT到了300ms，在高负载测试中，更是使TFB达到了5000ms。我个人认为可以接受的框架初始消耗的PCT应该在150ms以下，所以对高负载WEB应用使用ZF必须非常慎重。<br id="k21n" /> 2、对比低负载测试和高负载测试我们可以发现，TFB会因为负载的提高而明显增加，而随着代码复杂程度的提高，差距越来越大，最高到了382：5054<br id="gp_2" /> 3、对比低负载测试和高负载测试我们可以发现，在简单代码情况下，“低负载”的CT结果反而会高于“高负载”的结果，我推测这应该是由于Apache或者FastCGI的缓存机制造成；随着代码复杂程度的提高，高负载时服务器的的TFB明显提高，这一现象也被冲淡了。<br id="e3lq" /> 4、TFB是衡量网页对客户端响应速度的重要指标，我们可以发现，低负载测试结果中的TFB基本都等于相应的PCT + 80ms，这多出来的80ms应该就是Aapche+php的页面环境初始化所消耗的是时间，而这一时间是发生在PHP以外的，所以PHP自身是无法计时和统计到这一时间的。<br id="wum1" /> <br id="wum10" /></p>
</div>
<h3 id="zp8z2"><span style="color: #808080;">测试详细结果记录</span></h3>
<hr />
<p><br id="prs4" /> <strong id="o31o4">步骤</strong><strong id="o31o">一：</strong><br id="prs40" /> <strong id="z:sk">CODE：</strong><br id="z:sk0" /></p>
<p><br class="spacer_" /></p>
<div id="a3kh" style="margin-left: 40px;"><span style="color: #0000ff;">set_include_path(&#8216;app&#8217; . PATH_SEPARATOR </span><br id="z:id" style="color: #0000ff;" /> <span style="color: #0000ff;"> . &#8216;libs&#8217; . PATH_SEPARATOR</span><br id="z:id0" style="color: #0000ff;" /> <span style="color: #0000ff;"> . get_include_path());</span><br id="z:id1" style="color: #0000ff;" /></div>
<p><br id="z:id2" /> <strong id="y1mw">PHP Core Time:</strong><br id="e3vo" /> ~0.055 ms<br id="c_sy" /> <strong id="t.my">WT1：30U × 4C D2 （30用户，点击4次，间隔2秒）</strong><br id="qf_3" /></p>
<div id="hp2y" style="margin-left: 40px;">2008-6-18 18:47:02: Measured Times:<br id="wngl" /> 2008-6-18 18:47:02: Average Time to Create Local Socket for 30 Users: 2 ms <br id="wngl0" /> 2008-6-18 18:47:02: Average DNS Time for 30 Users: 71 ms <br id="wngl1" /> 2008-6-18 18:47:02: Average Time to Connect for 30 Users: 101 ms <br id="wngl2" /> 2008-6-18 18:47:02: Average Time to First Byte for 30 Users: <span style="color: #ff0000;">168 ms</span> <br id="wngl3" /> 2008-6-18 18:47:02: Average Click Time for 30 Users: 246 ms <br id="wngl4" /> 2008-6-18 18:47:02: <br id="wngl5" /> 2008-6-18 18:47:02: Hits per Second: 13.09 (equals 47,127.99 Hits per Hour)<br id="wngl6" /> 2008-6-18 18:47:02: Successful clicks per Second: 13.09 (equals 47,127.99 Clicks per Hour)<br id="wngl7" /> 2008-6-18 18:47:02: <br id="wngl8" /> 2008-6-18 18:47:02: Results per URL for this Period:<br id="wngl9" /> 2008-6-18 18:47:02: URL#1 (Test): <span style="color: #ff0000;">Average Click Time 246 ms</span>, 134 Clicks, 0 Errors, <br id="wngl10" /> 2008-6-18 18:47:02: Average Click Time of all URLs: 246 ms <br id="j2-2" /></div>
<p><br id="bowx" /> <strong id="t.my0">WT2：1U × 10C D2</strong><br id="fad4" /></p>
<div id="wexw" style="margin-left: 40px;">2008-6-18 18:50:15: Measured Times:<br id="wexw0" /> 2008-6-18 18:50:15: Average Time to Create Local Socket for 1 Users: 1 ms <br id="wexw1" /> 2008-6-18 18:50:15: Average DNS Time for 1 Users: 48 ms <br id="wexw2" /> 2008-6-18 18:50:15: Average Time to Connect for 1 Users: 49 ms <br id="wexw3" /> 2008-6-18 18:50:15: Average Time to First Byte for 1 Users<span style="color: #ff0000;">: 89 ms</span> <br id="wexw5" /> 2008-6-18 18:50:15: Average Click Time for 1 Users: 1,054 ms <br id="wexw6" /> 2008-6-18 18:50:15: <br id="wexw7" /> 2008-6-18 18:50:15: Hits per Second: 0.30 (equals 1,064.36 Hits per Hour)<br id="wexw8" /> 2008-6-18 18:50:15: Successful clicks per Second: 0.30 (equals 1,064.36 Clicks per Hour)<br id="wexw9" /> 2008-6-18 18:50:15: <br id="wexw10" /> 2008-6-18 18:50:15: Results per URL for this Period:<br id="wexw11" /> 2008-6-18 18:50:15: URL#1 (Test): <span style="color: #ff0000;">Average Click Time 1,054 ms</span>, 3 Clicks, 0 Errors, <br id="wexw13" /> 2008-6-18 18:50:15: Average Click Time of all URLs: 1,054 ms <br id="o31o0" /></div>
<p><br id="o31o1" /> <br id="cu9t" /></p>
<hr id="o31o3" size="2" />
<p><strong id="o31o4">步骤</strong><strong id="o31o4">二：<br id="z:sk4" /> </strong><strong id="z:sk5">CODE：</strong><br id="z:sk6" /></p>
<p><br class="spacer_" /></p>
<div id="zsbf" style="margin-left: 40px;"><span style="color: #0000ff;">+ require_once &#8220;Zend/Loader.php&#8221;;</span><br id="z:id1" style="color: #0000ff;" /></div>
<p><strong>PHP Core Time:</strong></p>
<p style="padding-left: 30px;">~1.9ms</p>
<p><strong id="t.my">WT1：30U × 4C D2 （30用户，点击4次，间隔2秒）<br id="amx7" /> </strong></p>
<div id="amx70" style="margin-left: 40px;">2008-6-18 19:11:40: Average Time to Create Local Socket for 30 Users: 1 ms <br id="amx71" /> 2008-6-18 19:11:40: Average DNS Time for 30 Users: 68 ms <br id="amx72" /> 2008-6-18 19:11:40: Average Time to Connect for 30 Users: 75 ms <br id="amx73" /> 2008-6-18 19:11:40: Average Time to First Byte for 30 Users: <strong id="amx74"><span style="color: #ff0000;">148 ms</span> </strong><br id="amx75" /> 2008-6-18 19:11:40: Average Click Time for 30 Users: 211 ms <br id="amx76" /> 2008-6-18 19:11:40: <br id="amx77" /> 2008-6-18 19:11:40: Hits per Second: 13.02 (equals 46,863.23 Hits per Hour)<br id="amx78" /> 2008-6-18 19:11:40: Successful clicks per Second: 13.02 (equals 46,863.23 Clicks per Hour)<br id="amx79" /> 2008-6-18 19:11:40: <br id="amx710" /> 2008-6-18 19:11:40: Results per URL for this Period:<br id="amx711" /> 2008-6-18 19:11:40: URL#1 (Test): Average Click Time <span style="color: #ff0000;">211 ms</span>, 133 Clicks, 0 Errors, <br id="amx712" /> <br id="bowx" /></div>
<p><strong id="t.my0">WT2：1U × 10C D2<br id="j8qr0" /> </strong></p>
<div id="j8qr1" style="margin-left: 40px;">2008-6-19 9:39:48: Average Time to Create Local Socket for 1 Users: 1 ms <br id="j8qr2" /> 2008-6-19 9:39:48: Average DNS Time for 1 Users: 50 ms <br id="j8qr3" /> 2008-6-19 9:39:48: Average Time to Connect for 1 Users: 52 ms <br id="j8qr4" /> 2008-6-19 9:39:48: Average Time to First Byte for 1 Users:<span style="color: #ff0000;"> 133 ms </span><br id="j8qr6" /> 2008-6-19 9:39:48: Average Click Time for 1 Users: 847 ms <br id="j8qr7" /> 2008-6-19 9:39:48: <br id="j8qr8" /> 2008-6-19 9:39:48: Hits per Second: 0.29 (equals 1,054.84 Hits per Hour)<br id="j8qr9" /> 2008-6-19 9:39:48: Successful clicks per Second: 0.29 (equals 1,054.84 Clicks per Hour)<br id="j8qr10" /> 2008-6-19 9:39:48: <br id="j8qr11" /> 2008-6-19 9:39:48: Results per URL for this Period:<br id="j8qr12" /> 2008-6-19 9:39:48: URL#1 (Test): Average Click Time <span style="color: #ff0000;">847 ms</span>, 3 Clicks, 0 Errors, <br id="fad4" /></div>
<p><br id="l6p1" /></p>
<p><img id="szvi0" alt="" /> <img id="do2p" alt="" /><img id="do2p0" alt="" /><br id="o31o0" /> <strong id="pbxy"><br id="vq4m0" /> </strong><br id="o31o2" /></p>
<hr id="o31o3" size="2" />
<p><strong id="o31o4">步骤</strong><strong id="o31o4">三：<br id="z:sk4" /> </strong><strong id="z:sk5">CODE：</strong><br id="z:sk6" /></p>
<p><br class="spacer_" /></p>
<div id="zsbf" style="margin-left: 40px;"><span style="color: #0000ff;">+ Zend_Loader::registerAutoload();</span><br id="z:id1" style="color: #0000ff;" /></div>
<p><br id="z:id2" /> <strong id="awps">PHP Core Time:</strong><br id="e3vo" /> ~2.7ms<br id="e3vo0" /> <strong id="t.my">WT1：30U × 4C D2 （30用户，点击4次，间隔2秒）<br id="amx7" /> </strong></p>
<div id="amx70" style="margin-left: 40px;">2008-6-19 9:50:03: Average Time to Create Local Socket for 30 Users: 1 ms <br id="wgu." /> 2008-6-19 9:50:03: Average DNS Time for 30 Users: 85 ms <br id="wgu.0" /> 2008-6-19 9:50:03: Average Time to Connect for 30 Users: 90 ms <br id="wgu.1" /> 2008-6-19 9:50:03: Average Time to First Byte for 30 Users: <span style="color: #ff0000;">229 ms </span><br id="wgu.3" /> 2008-6-19 9:50:03: Average Click Time for 30 Users: 299 ms <br id="wgu.4" /> 2008-6-19 9:50:03: <br id="wgu.5" /> 2008-6-19 9:50:03: Hits per Second: 12.71 (equals 45,772.06 Hits per Hour)<br id="wgu.6" /> 2008-6-19 9:50:03: Successful clicks per Second: 12.71 (equals 45,772.06 Clicks per Hour)<br id="wgu.7" /> 2008-6-19 9:50:03: <br id="wgu.8" /> 2008-6-19 9:50:03: Results per URL for this Period:<br id="wgu.9" /> 2008-6-19 9:50:03: URL#1 (Test): Average Click Time <span style="color: #ff0000;">299 ms</span>, 129 Clicks, 0 Errors, <br id="bowx" /></div>
<p><strong id="t.my0">WT2：1U × 10C D2<br id="j8qr0" /> </strong></p>
<div id="j8qr1" style="margin-left: 40px;">2008-6-19 9:51:56: Average Time to Create Local Socket for 1 Users: 1 ms <br id="qf07" /> 2008-6-19 9:51:56: Average DNS Time for 1 Users: 53 ms <br id="qf070" /> 2008-6-19 9:51:56: Average Time to Connect for 1 Users: 55 ms <br id="qf071" /> 2008-6-19 9:51:56: Average Time to First Byte for 1 Users: <span style="color: #ff0000;">144 ms </span><br id="qf073" /> 2008-6-19 9:51:56: Average Click Time for 1 Users: 1,010 ms <br id="qf074" /> 2008-6-19 9:51:56: <br id="qf075" /> 2008-6-19 9:51:56: Hits per Second: 0.30 (equals 1,062.37 Hits per Hour)<br id="qf076" /> 2008-6-19 9:51:56: Successful clicks per Second: 0.30 (equals 1,062.37 Clicks per Hour)<br id="qf077" /> 2008-6-19 9:51:56: <br id="qf078" /> 2008-6-19 9:51:56: Results per URL for this Period:<br id="qf079" /> 2008-6-19 9:51:56: URL#1 (Test): Average Click Time<span style="color: #ff0000;"> 1,010 ms</span>, 3 Clicks, 0 Errors, <br id="r9lh" /></div>
<p><br id="wt4m" /> <br id="o31o2" /></p>
<hr id="o31o3" size="2" />
<p><strong id="o31o4">步骤</strong><strong id="o31o4">四</strong><strong id="o31o4">：<br id="z:sk4" /> </strong><strong id="z:sk5">CODE：</strong><br id="z:sk6" /></p>
<p><br class="spacer_" /></p>
<div id="zsbf" style="margin-left: 40px;"><span style="color: #0000ff;">+ init Zend DB</span><br id="z:id1" style="color: #0000ff;" /></div>
<p><strong id="awps0">PHP Core Time:</strong><br id="e3vo" /> ~70ms<br id="e3vo0" /> <strong id="t.my">WT1：30U × 4C D2<br id="g-7x" /> </strong></p>
<div id="g-7x0" style="margin-left: 40px;">2008-6-19 10:33:46: Average Time to Create Local Socket for 30 Users: 2 ms <br id="uxi3" /> 2008-6-19 10:33:46: Average DNS Time for 30 Users: 82 ms <br id="uxi30" /> 2008-6-19 10:33:46: Average Time to Connect for 30 Users: 84 ms <br id="uxi31" /> 2008-6-19 10:33:46: Average Time to First Byte for 30 Users:<span style="color: #ff0000;"> 249 ms</span> <br id="uxi33" /> 2008-6-19 10:33:46: Average Click Time for 30 Users: 337 ms <br id="uxi34" /> 2008-6-19 10:33:46: <br id="uxi35" /> 2008-6-19 10:33:46: Hits per Second: 12.39 (equals 44,614.31 Hits per Hour)<br id="uxi36" /> 2008-6-19 10:33:46: Successful clicks per Second: 12.39 (equals 44,614.31 Clicks per Hour)<br id="uxi37" /> 2008-6-19 10:33:46: <br id="uxi38" /> 2008-6-19 10:33:46: Results per URL for this Period:<br id="uxi39" /> 2008-6-19 10:33:46: URL#1 (Test): Average Click Time <span style="color: #ff0000;">337 ms</span>, 124 Clicks, 0 Errors,  <br id="amx7" /></div>
<div id="amx70" style="margin-left: 40px;"><br id="bowx" /></div>
<p><strong id="t.my0">WT2：1U × 10C D2<br id="j8qr0" /> </strong> 2008-6-19 10:35:26: Average Time to Create Local Socket for 1 Users: 1 ms <br id="i_go0" /></p>
<div id="i_go1" style="margin-left: 40px;">2008-6-19 10:35:26: Average DNS Time for 1 Users: 46 ms <br id="i_go2" /> 2008-6-19 10:35:26: Average Time to Connect for 1 Users: 48 ms <br id="i_go3" /> 2008-6-19 10:35:26: Average Time to First Byte for 1 Users: <span style="color: #ff0000;">166 ms</span> <br id="i_go5" /> 2008-6-19 10:35:26: Average Click Time for 1 Users: 842 ms <br id="i_go6" /> 2008-6-19 10:35:26: <br id="i_go7" /> 2008-6-19 10:35:26: Hits per Second: 0.40 (equals 1,421.12 Hits per Hour)<br id="i_go8" /> 2008-6-19 10:35:26: Successful clicks per Second: 0.40 (equals 1,421.12 Clicks per Hour)<br id="i_go9" /> 2008-6-19 10:35:26: <br id="i_go10" /> 2008-6-19 10:35:26: Results per URL for this Period:<br id="i_go11" /> 2008-6-19 10:35:26: URL#1 (Test): Average Click Time <span style="color: #ff0000;">842 ms</span>, 4 Clicks, 0 Errors,<br id="i_go13" /> <br id="i_go14" /></div>
<p><br id="o31o2" /></p>
<hr id="o31o3" size="2" />
<p><strong id="o31o4">步骤</strong><strong id="o31o4">五</strong><strong id="o31o4">：<br id="z:sk4" /> </strong><strong id="z:sk5">CODE：</strong><br id="z:sk6" /></p>
<p><br class="spacer_" /></p>
<div id="zsbf" style="margin-left: 40px;"><span style="color: #0000ff;">+ init Zend Layout</span><br id="z:id1" style="color: #0000ff;" /></div>
<p><br id="z:id2" /> <strong id="awps0">PHP Core Time:</strong><br id="e3vo" /> ~150ms<br id="e3vo0" /> <strong id="t.my">WT1：30U × 4C D2<br id="g-7x" /> </strong></p>
<div id="g-7x0" style="margin-left: 40px;">2008-6-19 10:41:18: Average Time to Create Local Socket for 30 Users: 1 ms <br id="je4y" /> 2008-6-19 10:41:18: Average DNS Time for 30 Users: 90 ms <br id="je4y0" /> 2008-6-19 10:41:18: Average Time to Connect for 30 Users: 93 ms <br id="je4y1" /> 2008-6-19 10:41:18: Average Time to First Byte for 30 Users: <span style="color: #ff0000;">1,544 ms</span> <br id="je4y3" /> 2008-6-19 10:41:18: Average Click Time for 30 Users: 1,692 ms <br id="je4y4" /> 2008-6-19 10:41:18: <br id="je4y5" /> 2008-6-19 10:41:18: Hits per Second: 7.76 (equals 27,927.16 Hits per Hour)<br id="je4y6" /> 2008-6-19 10:41:18: Successful clicks per Second: 7.76 (equals 27,927.16 Clicks per Hour)<br id="je4y7" /> 2008-6-19 10:41:18: <br id="je4y8" /> 2008-6-19 10:41:18: Results per URL for this Period:<br id="je4y9" /> 2008-6-19 10:41:18: URL#1 (Test): Average Click Time <span style="color: #ff0000;">1,692 ms</span>, 80 Clicks, 0 Errors, <br id="amx7" /></div>
<div id="amx70" style="margin-left: 40px;"><br id="bowx" /></div>
<p><strong id="t.my0">WT2：1U × 10C D2<br id="j8qr0" /> </strong> 2008-6-19 10:42:48: Average Time to Create Local Socket for 1 Users: 1 ms <br id="e1m9" /></p>
<div id="e1m90" style="margin-left: 40px;">2008-6-19 10:42:48: Average DNS Time for 1 Users: 46 ms <br id="e1m91" /> 2008-6-19 10:42:48: Average Time to Connect for 1 Users: 47 ms <br id="e1m92" /> 2008-6-19 10:42:48: Average Time to First Byte for 1 Users: <span style="color: #ff0000;">229 ms</span> <br id="e1m94" /> 2008-6-19 10:42:48: Average Click Time for 1 Users: 1,053 ms <br id="e1m95" /> 2008-6-19 10:42:48: <br id="e1m96" /> 2008-6-19 10:42:48: Hits per Second: 0.40 (equals 1,424.74 Hits per Hour)<br id="e1m97" /> 2008-6-19 10:42:48: Successful clicks per Second: 0.40 (equals 1,424.74 Clicks per Hour)<br id="e1m98" /> 2008-6-19 10:42:48: <br id="e1m99" /> 2008-6-19 10:42:48: Results per URL for this Period:<br id="e1m910" /> 2008-6-19 10:42:48: URL#1 (Test): Average Click Time <span style="color: #ff0000;">1,053 ms</span>, 4 Clicks, 0 Errors, <br id="y87x" /> <br id="y87x0" /></div>
<hr id="b5.y" size="2" />
<p><strong id="o31o4">步骤</strong><strong id="o31o4">六</strong><strong id="o31o4">：<br id="z:sk4" /> </strong><strong id="z:sk5">CODE：</strong><br id="z:sk6" /></p>
<p><br class="spacer_" /></p>
<div id="zsbf" style="margin-left: 40px;"><span style="color: #0000ff;">+ init Zend View<br id="y87x1" /> + init Zend User<br id="z:id1" style="color: #0000ff;" /> </span></div>
<p><br id="z:id2" /> <strong id="awps0">PHP Core Time:</strong><br id="e3vo" /> ~150ms<br id="e3vo0" /> <strong id="t.my">WT1：30U × 4C D2<br id="g-7x" /> </strong></p>
<div id="g-7x0" style="margin-left: 40px;">2008-6-19 11:27:59: Average Time to Create Local Socket for 30 Users: 1 ms <br id="ntc9" /> 2008-6-19 11:27:59: Average DNS Time for 30 Users: 77 ms <br id="ntc90" /> 2008-6-19 11:27:59: Average Time to Connect for 30 Users: 85 ms <br id="ntc91" /> 2008-6-19 11:27:59: Average Time to First Byte for 30 Users: <span style="color: #ff0000;">2,430 ms </span><br id="ntc93" /> 2008-6-19 11:27:59: Average Click Time for 30 Users: 2,552 ms <br id="ntc94" /> 2008-6-19 11:27:59: <br id="ntc95" /> 2008-6-19 11:27:59: Hits per Second: 6.33 (equals 22,786.27 Hits per Hour)<br id="ntc96" /> 2008-6-19 11:27:59: Successful clicks per Second: 6.33 (equals 22,786.27 Clicks per Hour)<br id="ntc97" /> 2008-6-19 11:27:59: <br id="ntc98" /> 2008-6-19 11:27:59: Results per URL for this Period:<br id="ntc99" /> 2008-6-19 11:27:59: URL#1 (Test): Average Click Time <span style="color: #ff0000;">2,552 ms</span>, 65 Clicks, 0 Errors, <br id="amx7" /></div>
<div id="amx70" style="margin-left: 40px;"><br id="bowx" /></div>
<p><strong id="t.my0">WT2：1U × 10C D2</strong></p>
<div id="e1m90" style="margin-left: 40px;">2008-6-19 11:24:37: Average Time to Create Local Socket for 1 Users: 1 ms <br id="y87x3" /> 2008-6-19 11:24:37: Average DNS Time for 1 Users: 46 ms <br id="y87x4" /> 2008-6-19 11:24:37: Average Time to Connect for 1 Users: 47 ms <br id="y87x5" /> 2008-6-19 11:24:37: Average Time to First Byte for 1 Users: <span style="color: #ff0000;">254 ms</span> <br id="y87x6" /> 2008-6-19 11:24:37: Average Click Time for 1 Users: 741 ms <br id="y87x7" /> 2008-6-19 11:24:37: <br id="y87x8" /> 2008-6-19 11:24:37: Hits per Second: 0.39 (equals 1,411.08 Hits per Hour)<br id="y87x9" /> 2008-6-19 11:24:37: Successful clicks per Second: 0.39 (equals 1,411.08 Clicks per Hour)<br id="y87x10" /> 2008-6-19 11:24:37: <br id="y87x11" /> 2008-6-19 11:24:37: Results per URL for this Period:<br id="y87x12" /> 2008-6-19 11:24:37: URL#1 (Test): Average Click Time<span style="color: #ff0000;"> 741 ms</span>, 4 Clicks, 0 Errors, <br id="wwcs" /></div>
<div id="i_go15">
<p><br id="t.my1" /></p>
<hr id="b5.y0" size="2" />
<strong id="o31o4">步骤</strong><strong id="o31o4">七</strong><strong id="o31o4">（完成）：<br id="z:sk4" /> </strong><strong id="z:sk5">CODE：</strong><br id="z:sk6" /></p>
<p><br class="spacer_" /></p>
<div id="zsbf" style="margin-left: 40px;"><span style="color: #0000ff;">+ init Zend_Controller_Front<br id="vnny" /> + dispatch &amp; run<br id="y87x1" /> <br id="jg90" /> </span></div>
<p><strong id="awps0">PHP Core Time:</strong><br id="e3vo" /> ~300ms<br id="e3vo0" /> <strong id="t.my">WT1：30U × 4C D2<br id="g-7x" /> </strong></p>
<div id="g-7x0" style="margin-left: 40px;">2008-6-19 11:33:51: Average Time to Create Local Socket for 30 Users: 2 ms <br id="j4yh" /> 2008-6-19 11:33:51: Average DNS Time for 30 Users: 101 ms <br id="j4yh0" /> 2008-6-19 11:33:51: Average Time to Connect for 30 Users: 114 ms <br id="j4yh1" /> 2008-6-19 11:33:51: Average Time to First Byte for 30 Users: <span style="color: #ff0000;">5,054 ms</span> <br id="j4yh3" /> 2008-6-19 11:33:51: Average Click Time for 30 Users: 5,404 ms <br id="j4yh4" /> 2008-6-19 11:33:51: <br id="j4yh5" /> 2008-6-19 11:33:51: Hits per Second: 4.14 (equals 14,890.34 Hits per Hour)<br id="j4yh6" /> 2008-6-19 11:33:51: Successful clicks per Second: 4.14 (equals 14,890.34 Clicks per Hour)<br id="j4yh7" /> 2008-6-19 11:33:51: <br id="j4yh8" /> 2008-6-19 11:33:51: Results per URL for this Period:<br id="j4yh9" /> 2008-6-19 11:33:51: URL#1 (Test): Average Click Time <span style="color: #ff0000;">5,404 ms</span>, 43 Clicks, 0 Errors, <br id="amx7" /></div>
<div id="amx70" style="margin-left: 40px;"><br id="bowx" /></div>
<p><strong id="t.my0">WT2：1U × 10C D2</strong></p>
<div id="e1m90" style="margin-left: 40px;">2008-6-19 11:35:03: Average Time to Create Local Socket for 1 Users: 1 ms <br id="m48a" /> 2008-6-19 11:35:03: Average DNS Time for 1 Users: 47 ms <br id="m48a0" /> 2008-6-19 11:35:03: Average Time to Connect for 1 Users: 48 ms <br id="m48a1" /> 2008-6-19 11:35:03: Average Time to First Byte for 1 Users: <span style="color: #ff0000;">382 ms</span> <br id="m48a3" /> 2008-6-19 11:35:03: Average Click Time for 1 Users: 1,053 ms <br id="m48a4" /> 2008-6-19 11:35:03: <br id="m48a5" /> 2008-6-19 11:35:03: Hits per Second: 0.40 (equals 1,424.61 Hits per Hour)<br id="m48a6" /> 2008-6-19 11:35:03: Successful clicks per Second: 0.40 (equals 1,424.61 Clicks per Hour)<br id="m48a7" /> 2008-6-19 11:35:03: <br id="m48a8" /> 2008-6-19 11:35:03: Results per URL for this Period:<br id="m48a9" /> 2008-6-19 11:35:03: URL#1 (Test): Average Click Time <span style="color: #ff0000;">1,053 ms</span>, 4 Clicks, 0 Errors, <br id="b5.y2" /></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://lee.kometo.com/archives/106/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

