<?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>Tairan&#039;s Story &#187; PHP</title>
	<atom:link href="http://www.tairan.net/index.php/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tairan.net</link>
	<description>「知之真切笃实处即是行，行之明觉精察处即是知，知行工夫不可离。」</description>
	<lastBuildDate>Fri, 02 Dec 2011 08:08:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>我学习Kohana的方法</title>
		<link>http://www.tairan.net/index.php/2010/06/23/my-way-for-learning-kohana/</link>
		<comments>http://www.tairan.net/index.php/2010/06/23/my-way-for-learning-kohana/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 12:55:16 +0000</pubDate>
		<dc:creator>Daniel Wang</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[我的声音]]></category>
		<category><![CDATA[Kohana]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.tairan.net/?p=845</guid>
		<description><![CDATA[Kohana 是一个PHP的开放框架，所以在学习之前需要深入了解PHP。另外Kohana也是一个遵循MVC模式的开发框架，同样在学习之前还需要深入了解什么是MVC，最好动手写过MVC模式的页面，一个练习也行。 接下来我们从那里开始呢？ 在动手练习之前，需要阅读文档。先哲说：闲时读手册，忙时问Google。刚开始我们有充裕的时间，那么开始阅读文档吧。 作为入门，属于Getting Started的文档需要优先阅读。通过阅读What is Kohana?，来了解下Kohana都有哪些东西。而 Model View Controller则告诉你Kohana使用了一种改良型的MVC模式。接下来 Cascading Filesystem 告诉你这个改良型的MVC模式是怎么工作的。最后通过阅读Request Flow来了解从浏览器发出请求后Kohana在服务器端是怎么处理的。okay，通过阅读以上的文档就入门了。 阳明先生说，知是行之始，行是知之果，知行功夫不可离。意思是光看文档并不代表你知道，需要动手操练一番才算真知道。 Kohana安装还是很容易的，将整个工程放到web服务器上就可以工作了。如果遇到问题跑不起来怎么办？Fix it! 安迪教授也说了，当你在工作过程中没有得到想要的东西时你就获得了经验。 程序员动手的第一招是&#8221;Hello World&#8221;，Kohana已经提供了这一招，所以通过阅读源码来学习这一招是如何发出的，因为Kohana是改良的MVC(也就是HMVC)，那么需要多注意项目的目录结构，看看这些源文件是以什么样的方式组织的。在观摩Kohana提供的入门招数后，让我们来破解这个招式。尝试着修改文件名，类名，以及改变文件目录位置等来验证这一招在什么情况下会失效，这对你加深理解有帮助。 入门招数，学了也拆了，开始模拟演练吧。 新手入门第一课，留言板。很多前辈都推荐新手来实现一个留言板用以学习新的开发环境。动手之前，我们要有个蓝图，不用大，将期望了解的知识点囊括进去即可。web开发的知识点通常有，Session,Cookie的管理，数据库的操作，URL的管理，Ajax，表单验证，异常处理等。限定已经有了，那么就开始来实现留言板吧。 演练开始我们就忙了起来，这时Google就发挥作用了，遇到疑难杂症问Google。作为修炼内力，阅读API加深理解各个类是如何工作。 最后，先哲也说了，尽信书不如无书。文档也有bug，当实际操作和文档描述的行为不相符的时候，那么我们就要玩外科手术了。这就是开源的好处，有bug直接解剖，肚皮划开后一目了然！ © Daniel Wang for Tairan&#039;s Story, 2010. &#124; Permalink &#124; 2 comments &#124; Add to del.icio.us Post tags: Kohana, PHP Feed enhanced by Better Feed from Ozh]]></description>
			<content:encoded><![CDATA[<p>Kohana 是一个PHP的开放框架，所以在学习之前需要深入了解PHP。另外Kohana也是一个遵循MVC模式的开发框架，同样在学习之前还需要深入了解什么是MVC，最好动手写过MVC模式的页面，一个练习也行。</p>
<p>接下来我们从那里开始呢？</p>
<p>在动手练习之前，需要阅读文档。先哲说：闲时读手册，忙时问Google。刚开始我们有充裕的时间，那么开始阅读文档吧。</p>
<p>作为入门，属于<strong>Getting Started</strong>的文档需要优先阅读。通过阅读<a href="http://kohanaframework.org/guide/about.kohana" target="_blank">What is Kohana?</a>，来了解下Kohana都有哪些东西。而 <a href="http://kohanaframework.org/guide/about.mvc" target="_blank">Model View Controller</a>则告诉你Kohana使用了一种改良型的MVC模式。接下来 <a href="http://kohanaframework.org/guide/about.filesystem" target="_blank">Cascading Filesystem</a> 告诉你这个改良型的MVC模式是怎么工作的。最后通过阅读<a href="http://kohanaframework.org/guide/about.flow" target="_blank">Request Flow</a>来了解从浏览器发出请求后Kohana在服务器端是怎么处理的。okay，通过阅读以上的文档就入门了。</p>
<p>阳明先生说，知是行之始，行是知之果，知行功夫不可离。意思是光看文档并不代表你知道，需要动手操练一番才算真知道。</p>
<p>Kohana安装还是很容易的，将整个工程放到web服务器上就可以工作了。如果遇到问题跑不起来怎么办？Fix it! 安迪教授也说了，当你在工作过程中没有得到想要的东西时你就获得了经验。</p>
<p>程序员动手的第一招是&#8221;Hello World&#8221;，Kohana已经提供了这一招，所以通过阅读源码来学习这一招是如何发出的，因为Kohana是改良的MVC(也就是HMVC)，那么需要多注意项目的目录结构，看看这些源文件是以什么样的方式组织的。在观摩Kohana提供的入门招数后，让我们来破解这个招式。尝试着修改文件名，类名，以及改变文件目录位置等来验证这一招在什么情况下会失效，这对你加深理解有帮助。</p>
<p>入门招数，学了也拆了，开始模拟演练吧。</p>
<p>新手入门第一课，留言板。很多前辈都推荐新手来实现一个留言板用以学习新的开发环境。动手之前，我们要有个蓝图，不用大，将期望了解的知识点囊括进去即可。web开发的知识点通常有，Session,Cookie的管理，数据库的操作，URL的管理，Ajax，表单验证，异常处理等。限定已经有了，那么就开始来实现留言板吧。</p>
<p>演练开始我们就忙了起来，这时Google就发挥作用了，遇到疑难杂症问Google。作为修炼内力，阅读<a href="http://kohanaframework.org/guide/api">API</a>加深理解各个类是如何工作。</p>
<p>最后，先哲也说了，尽信书不如无书。文档也有bug，当实际操作和文档描述的行为不相符的时候，那么我们就要玩外科手术了。这就是开源的好处，有bug直接解剖，肚皮划开后一目了然！</p>
<hr />
<p><small>© Daniel Wang for <a href="http://www.tairan.net">Tairan&#039;s Story</a>, 2010. |
<a href="http://www.tairan.net/index.php/2010/06/23/my-way-for-learning-kohana/">Permalink</a> |
<a href="http://www.tairan.net/index.php/2010/06/23/my-way-for-learning-kohana/#comments">2 comments</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.tairan.net/index.php/2010/06/23/my-way-for-learning-kohana/&title=我学习Kohana的方法">del.icio.us</a>
<br/>
Post tags: <a href="http://www.tairan.net/index.php/tag/kohana/" rel="tag">Kohana</a>, <a href="http://www.tairan.net/index.php/tag/php/" rel="tag">PHP</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tairan.net/index.php/2010/06/23/my-way-for-learning-kohana/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>如何识别手机浏览器信息</title>
		<link>http://www.tairan.net/index.php/2010/04/16/how-to-identify-mobile-browser/</link>
		<comments>http://www.tairan.net/index.php/2010/04/16/how-to-identify-mobile-browser/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 13:05:29 +0000</pubDate>
		<dc:creator>Daniel Wang</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[实践手札]]></category>
		<category><![CDATA[我的声音]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.tairan.net/?p=802</guid>
		<description><![CDATA[想作一个网站，根据不同的访问者提供不同的显示模板，如适合手机的模板，适合PC浏览器的模板。 从哪里识别访问者的信息，以及如何识别呢？ 依据 HTTP 协议，客户端浏览网页的时候会提供一些信息给服务器端。下面是PC浏览器访问时的 $_SERVER 的 dump 信息。 &#40;array&#41; Array &#40; &#91;ALL_HTTP&#93; =&#62; HTTP_CACHE_CONTROL:max-age=0 HTTP_CONNECTION:keep-alive HTTP_CONTENT_LENGTH:0 HTTP_ACCEPT:application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 HTTP_ACCEPT_CHARSET:ISO-8859-1,utf-8;q=0.7,*;q=0.3 HTTP_ACCEPT_ENCODING:gzip,deflate,sdch HTTP_ACCEPT_LANGUAGE:en-US,en;q=0.8 HTTP_COOKIE:__utmz=259664206.1262318873.1.1.utmcsr=google&#124;utmccn=(organic)&#124;utmcmd=organic&#124;utmctr=51xna; __utma=259664206.724256099.1262318873.1262318873.1262318873.1 HTTP_HOST:www.51xna.com HTTP_USER_AGENT:Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/533.2 (KHTML, like Gecko) Chrome/5.0.342.9 Safari/533.2 &#160; [HTTPS] =&#62; off [SCRIPT_NAME] =&#62; /private/Kohana/index.php [HTTP_COOKIE] =&#62; __utmz=259664206.1262318873.1.1.utmcsr=google&#124;utmccn=(organic)&#124;utmcmd=organic&#124;utmctr=51xna; __utma=259664206.724256099.1262318873.1262318873.1262318873.1 [AUTH_PASSWORD] =&#62; [AUTH_TYPE] =&#62; [AUTH_USER] =&#62; [CONTENT_LENGTH] =&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>想作一个网站，根据不同的访问者提供不同的显示模板，如适合手机的模板，适合PC浏览器的模板。</p>
<p> 从哪里识别访问者的信息，以及如何识别呢？</p>
<p>依据 HTTP 协议，客户端浏览网页的时候会提供一些信息给服务器端。下面是PC浏览器访问时的 <a href="http://cn.php.net/manual/en/reserved.variables.server.php" target="_blank">$_SERVER</a> 的 dump 信息。</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#41;</span> <span style="color: #990000;">Array</span>
<span style="color: #009900;">&#40;</span>
    <span style="color: #009900;">&#91;</span>ALL_HTTP<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> HTTP_CACHE_CONTROL<span style="color: #339933;">:</span>max<span style="color: #339933;">-</span>age<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span>
HTTP_CONNECTION<span style="color: #339933;">:</span>keep<span style="color: #339933;">-</span>alive
HTTP_CONTENT_LENGTH<span style="color: #339933;">:</span><span style="color: #cc66cc;">0</span>
HTTP_ACCEPT<span style="color: #339933;">:</span>application<span style="color: #339933;">/</span>xml<span style="color: #339933;">,</span>application<span style="color: #339933;">/</span>xhtml<span style="color: #339933;">+</span>xml<span style="color: #339933;">,</span>text<span style="color: #339933;">/</span>html<span style="color: #339933;">;</span>q<span style="color: #339933;">=</span><span style="color:#800080;">0.9</span><span style="color: #339933;">,</span>text<span style="color: #339933;">/</span>plain<span style="color: #339933;">;</span>q<span style="color: #339933;">=</span><span style="color:#800080;">0.8</span><span style="color: #339933;">,</span>image<span style="color: #339933;">/</span>png<span style="color: #339933;">,*</span><span style="color: #666666; font-style: italic;">/*;q=0.5
HTTP_ACCEPT_CHARSET:ISO-8859-1,utf-8;q=0.7,*;q=0.3
HTTP_ACCEPT_ENCODING:gzip,deflate,sdch
HTTP_ACCEPT_LANGUAGE:en-US,en;q=0.8
HTTP_COOKIE:__utmz=259664206.1262318873.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=51xna; __utma=259664206.724256099.1262318873.1262318873.1262318873.1
HTTP_HOST:www.51xna.com
HTTP_USER_AGENT:Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/533.2 (KHTML, like Gecko) Chrome/5.0.342.9 Safari/533.2
&nbsp;
    [HTTPS] =&gt; off
    [SCRIPT_NAME] =&gt; /private/Kohana/index.php
    [HTTP_COOKIE] =&gt; __utmz=259664206.1262318873.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=51xna; __utma=259664206.724256099.1262318873.1262318873.1262318873.1
    [AUTH_PASSWORD] =&gt; 
    [AUTH_TYPE] =&gt; 
    [AUTH_USER] =&gt; 
    [CONTENT_LENGTH] =&gt; 0
    [CONTENT_TYPE] =&gt; 
    [PATH_TRANSLATED] =&gt; g:\wwwroot\51xna.com\wwwroot\mobile\index
    [QUERY_STRING] =&gt; 
    [REMOTE_ADDR] =&gt; 221.227.130.23
    [REMOTE_HOST] =&gt; 221.227.130.23
    [REMOTE_USER] =&gt; 
    [REQUEST_METHOD] =&gt; GET
    [SERVER_NAME] =&gt; www.51xna.com
    [SERVER_PORT] =&gt; 80
    [SERVER_PROTOCOL] =&gt; HTTP/1.1
    [SERVER_SOFTWARE] =&gt; Microsoft-IIS/6.0
    [APPL_MD_PATH] =&gt; /LM/w3svc/798/ROOT
    [APPL_PHYSICAL_PATH] =&gt; g:\wwwroot\51xna.com\wwwroot\
    [INSTANCE_ID] =&gt; 798
    [INSTANCE_META_PATH] =&gt; /LM/W3SVC/798
    [LOGON_USER] =&gt; 
    [REQUEST_URI] =&gt; /private/Kohana/index.php/mobile/index
    [URL] =&gt; /private/Kohana/index.php/mobile/index
    [SCRIPT_FILENAME] =&gt; g:\wwwroot\51xna.com\wwwroot\private\Kohana\index.php
    [ORIG_PATH_INFO] =&gt; /private/Kohana/index.php/mobile/index
    [PATH_INFO] =&gt; /mobile/index
    [ORIG_PATH_TRANSLATED] =&gt; g:\wwwroot\51xna.com\wwwroot\private\Kohana\index.php\mobile\index
    [DOCUMENT_ROOT] =&gt; g:\wwwroot\51xna.com\wwwroot
    [PHP_SELF] =&gt; /private/Kohana/index.php
    [HTTP_CACHE_CONTROL] =&gt; max-age=0
    [HTTP_CONNECTION] =&gt; keep-alive
    [HTTP_CONTENT_LENGTH] =&gt; 0
    [HTTP_ACCEPT] =&gt; application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/</span><span style="color: #339933;">*;</span>q<span style="color: #339933;">=</span><span style="color:#800080;">0.5</span>
    <span style="color: #009900;">&#91;</span>HTTP_ACCEPT_CHARSET<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> ISO<span style="color: #339933;">-</span><span style="color: #cc66cc;">8859</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>utf<span style="color: #339933;">-</span><span style="color: #cc66cc;">8</span><span style="color: #339933;">;</span>q<span style="color: #339933;">=</span><span style="color:#800080;">0.7</span><span style="color: #339933;">,*;</span>q<span style="color: #339933;">=</span><span style="color:#800080;">0.3</span>
    <span style="color: #009900;">&#91;</span>HTTP_ACCEPT_ENCODING<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> gzip<span style="color: #339933;">,</span>deflate<span style="color: #339933;">,</span>sdch
    <span style="color: #009900;">&#91;</span>HTTP_ACCEPT_LANGUAGE<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> en<span style="color: #339933;">-</span>US<span style="color: #339933;">,</span>en<span style="color: #339933;">;</span>q<span style="color: #339933;">=</span><span style="color:#800080;">0.8</span>
    <span style="color: #009900;">&#91;</span>HTTP_HOST<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> www<span style="color: #339933;">.</span>51xna<span style="color: #339933;">.</span>com
    <span style="color: #009900;">&#91;</span>HTTP_USER_AGENT<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> Mozilla<span style="color: #339933;">/</span><span style="color:#800080;">5.0</span> <span style="color: #009900;">&#40;</span>X11<span style="color: #339933;">;</span> U<span style="color: #339933;">;</span> Linux i686<span style="color: #339933;">;</span> en<span style="color: #339933;">-</span>US<span style="color: #009900;">&#41;</span> AppleWebKit<span style="color: #339933;">/</span><span style="color:#800080;">533.2</span> <span style="color: #009900;">&#40;</span>KHTML<span style="color: #339933;">,</span> like Gecko<span style="color: #009900;">&#41;</span> Chrome<span style="color: #339933;">/</span>5<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>342<span style="color: #339933;">.</span>9 Safari<span style="color: #339933;">/</span><span style="color:#800080;">533.2</span>
    <span style="color: #009900;">&#91;</span>REQUEST_TIME<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1271408243</span>
    <span style="color: #009900;">&#91;</span>argv<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">Array</span>
        <span style="color: #009900;">&#40;</span>
        <span style="color: #009900;">&#41;</span>
&nbsp;
    <span style="color: #009900;">&#91;</span>argc<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span>
<span style="color: #009900;">&#41;</span></pre></div></div>

<p>通常我们可以在HTTP_USER_AGENT中找到识别信息，其中PC浏览器的HTTP_USER_AGENT信息最全，很容易根据关键字来识别如&#8217;Chrome&#8217;, &#8216;Firefox&#8217; 等，部分手机浏览器也可以可以通过 &#8216;Windows Mobile&#8217;, &#8216;Windows Phone&#8217;, &#8216;SymbianOS&#8217;, &#8216;Nokia&#8217;, &#8216;Opera Mobi&#8217;, &#8216;Android&#8217;等关键字识别，这里有一个手机HTTP_USER_AGENT识别列表<a href="http://www.zytrax.com/tech/web/mobile_ids.html" target="_blank">http://www.zytrax.com/tech/web/mobile_ids.html</a>。但是有些手机上的浏览器并不提供HTTP_USER_AGENT信息。</p>
<p>如今的智能手机大多都支持 XHTML 格式浏览，我们可以通过 HTTP_ACCEPT 来识别手机是否支持 XHTML 格式浏览。这里识别的关键字主要是 &#8216;application/xhtml+xml&#8217;。</p>
<p>另外还有一种识别方式，通过查找用户的上网方式，通常手机用户走的是 GPRS 路线，但是这中识别方式并不可靠，可以作为一种辅助识别手段。</p>
<p>对于只支持 WML 的手机目前我还没有解决，一些非智能手机在访问网站时会提示&#8221;不支持所访问的网站&#8221;。开始我以为是返回信息的问题，当我把返回信息严格按照WML格式输出时问题依然存在。不知道这种手机是通过什么方式访问互联网的。</p>
<p>为所有用户提供不同的定制服务是一件不可能的完成任务，支持大多数就好。完美主义总是很浪费时间。</p>
<p>最后感谢各位提供手机访问信息的童鞋们，让你们忍受在手机上输入如此之长的URL，实在辛苦！</p>
<hr />
<p><small>© Daniel Wang for <a href="http://www.tairan.net">Tairan&#039;s Story</a>, 2010. |
<a href="http://www.tairan.net/index.php/2010/04/16/how-to-identify-mobile-browser/">Permalink</a> |
<a href="http://www.tairan.net/index.php/2010/04/16/how-to-identify-mobile-browser/#comments">One comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.tairan.net/index.php/2010/04/16/how-to-identify-mobile-browser/&title=如何识别手机浏览器信息">del.icio.us</a>
<br/>
Post tags: <a href="http://www.tairan.net/index.php/tag/browser/" rel="tag">Browser</a>, <a href="http://www.tairan.net/index.php/tag/mobile/" rel="tag">Mobile</a>, <a href="http://www.tairan.net/index.php/tag/php/" rel="tag">PHP</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tairan.net/index.php/2010/04/16/how-to-identify-mobile-browser/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>IIS &amp; FastCGI</title>
		<link>http://www.tairan.net/index.php/2008/10/20/iis-fastcgi/</link>
		<comments>http://www.tairan.net/index.php/2008/10/20/iis-fastcgi/#comments</comments>
		<pubDate>Mon, 20 Oct 2008 03:17:36 +0000</pubDate>
		<dc:creator>Daniel Wang</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[我的声音]]></category>
		<category><![CDATA[FastCGI]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.tairan.org/?p=60</guid>
		<description><![CDATA[Blog 自从搬家到 PHP5ISAPI +  IIS + Windows 平台上以来，竟然让服务器宕机多次。查看event log 也没有发现到什么可疑信息。在PHP manual提到以下信息: If you experience 100% CPU usage after some time, turn off the IIS setting Cache ISAPI Application. 关于这个选项，反复设置可还是出现宕机的情况。看来ISAPI不是那么的可靠。但在IIS上，用什么方式才是PHP的最佳？ FastCGI，Microsoft说这个可以提升PHP在Windows的性能xx倍！稳定性也好！东家这么使劲的鼓吹这玩意，总有一定的道理。实践出真知，先用上再说！ 果然，一天下来没再见到Windows宕机。验证的时间是短了点，但是总还是给我带来了欣喜。 参考资料: 配置FastCGI http://www.pcvc.net/archive/2008/8/26/90.html 中文，简易配置版 http://learn.iis.net/page.aspx/248/configuring-fastcgi-extension-for-iis60/ 官方英文 IIS 6 http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-70/ 官方英文 IIS 7 © Daniel Wang for Tairan&#039;s Story, 2008. &#124; Permalink &#124; No comment [...]]]></description>
			<content:encoded><![CDATA[<p>Blog 自从搬家到 PHP5ISAPI +  IIS + Windows 平台上以来，竟然让服务器宕机多次。查看event log 也没有发现到什么可疑信息。在PHP manual提到以下信息:<br />
<code>If you experience 100% CPU usage after some time, turn off the IIS setting Cache ISAPI Application. </code></p>
<p>关于这个选项，反复设置可还是出现宕机的情况。看来ISAPI不是那么的可靠。但在IIS上，用什么方式才是PHP的最佳？</p>
<p>FastCGI，Microsoft说这个可以提升PHP在Windows的性能xx倍！稳定性也好！东家这么使劲的鼓吹这玩意，总有一定的道理。实践出真知，先用上再说！</p>
<p>果然，一天下来没再见到Windows宕机。验证的时间是短了点，但是总还是给我带来了欣喜。</p>
<p>参考资料:</p>
<p>配置FastCGI</p>
<p><a href="http://www.pcvc.net/archive/2008/8/26/90.html" target="_blank">http://www.pcvc.net/archive/2008/8/26/90.html</a> 中文，简易配置版</p>
<p><a href="http://learn.iis.net/page.aspx/248/configuring-fastcgi-extension-for-iis60/" target="_blank">http://learn.iis.net/page.aspx/248/configuring-fastcgi-extension-for-iis60/</a> 官方英文 IIS 6</p>
<p><a href="http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-70/" target="_blank">http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-70/</a> 官方英文 IIS 7</p>
<hr />
<p><small>© Daniel Wang for <a href="http://www.tairan.net">Tairan&#039;s Story</a>, 2008. |
<a href="http://www.tairan.net/index.php/2008/10/20/iis-fastcgi/">Permalink</a> |
<a href="http://www.tairan.net/index.php/2008/10/20/iis-fastcgi/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.tairan.net/index.php/2008/10/20/iis-fastcgi/&title=IIS &#038; FastCGI">del.icio.us</a>
<br/>
Post tags: <a href="http://www.tairan.net/index.php/tag/fastcgi/" rel="tag">FastCGI</a>, <a href="http://www.tairan.net/index.php/tag/iis/" rel="tag">IIS</a>, <a href="http://www.tairan.net/index.php/tag/php/" rel="tag">PHP</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tairan.net/index.php/2008/10/20/iis-fastcgi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FleaPHP 学习笔记 (-)</title>
		<link>http://www.tairan.net/index.php/2008/06/02/the-learning-note-for-fleaphp/</link>
		<comments>http://www.tairan.net/index.php/2008/06/02/the-learning-note-for-fleaphp/#comments</comments>
		<pubDate>Mon, 02 Jun 2008 07:01:00 +0000</pubDate>
		<dc:creator>Daniel Wang</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[我的声音]]></category>
		<category><![CDATA[FleaPHP]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Framework]]></category>

		<guid isPermaLink="false">http://tairan.wordpress.com/2008/06/02/fleaphp-%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0/</guid>
		<description><![CDATA[FleaPHP 上手还算是很容易的，毕竟都是中文的文档。(阅读没有什么限制)FleaPHP 官方网站对如何安装使用做了大量的工作，只是有些细节问题需要注意一下。下面记录下自己运行第一个controller 下载&#38;安装我现在的是最新稳定版本 1.0.70.1078FleaPHP 的安装是很容易的，可以放到web site的任意地方，建议采用官方自带的检测工具来测试当前工作环境。 目录结构 (简述)FleaPHP 的安装倒是很容易，但是开始写东西的时候就要注意了，目录结构是严格的，并且区分大小写 demo/App/Controller/Default.php&#60;?phpclass Controller_Default //extends FLEA_Controller_Action 这里好像不需要显式继承{ function actionIndex() { echo &#8220;controller index&#8221;; } function actionSayHello() { echo &#8220;say hello fleaPHP&#8221;; }}?&#62; /index.php &#60;?phprequire(&#8216;FLEA/FLEA.php&#8217;);FLEA::import(dirname(__FILE__) . &#8216;/App&#8217;); //这是我们程序的所在地FLEA::runMVC();? /FLEAFLEA 存放目录 在这里，index.php作为一个控制中心，负责寻找和调用Controller, 如我们调用actionSayHello 那么可以通过URL 这样做http://localhost/?action=SayHello © Daniel Wang for Tairan&#039;s Story, 2008. &#124; Permalink &#124; No comment &#124; Add [...]]]></description>
			<content:encoded><![CDATA[<p>FleaPHP 上手还算是很容易的，毕竟都是中文的文档。(阅读没有什么限制)<br />FleaPHP 官方网站对如何安装使用做了大量的工作，只是有些细节问题需要注意一下。下面记录下自己运行第一个controller</p>
<p>下载&amp;安装<br />我现在的是最新稳定版本 1.0.70.1078<br />FleaPHP 的安装是很容易的，可以放到web site的任意地方，建议采用官方自带的检测工具来测试当前工作环境。</p>
<p>目录结构 (简述)<br />FleaPHP 的安装倒是很容易，但是开始写东西的时候就要注意了，目录结构是严格的，并且区分大小写</p>
<p>demo<br />/App/Controller/Default.php<br />&lt;?php<br />class Controller_Default <span style="color:rgb(0,102,0);">//extends FLEA_Controller_Action</span><img style="color:rgb(0,102,0);" width="1" height="1" /><span style="color:rgb(0,102,0);"> 这里好像不需要显式继承</span><br />{<br />    function actionIndex() {<br />        echo &#8220;controller index&#8221;;   <br />    }</p>
<p>    function actionSayHello() {<br />        echo &#8220;say hello fleaPHP&#8221;;<br />    }<br />}<br />?&gt;</p>
<p>/index.php</p>
<p>&lt;?php<br />require(&#8216;FLEA/FLEA.php&#8217;);<br />FLEA::import(dirname(__FILE__) . &#8216;/App&#8217;); <span style="color:rgb(0,102,0);">//这是我们程序的所在地</span><br />FLEA::runMVC();<br />?</p>
<p>/FLEA<br />FLEA 存放目录</p>
<p>在这里，index.php作为一个控制中心，负责寻找和调用Controller, 如我们调用actionSayHello 那么可以通过URL 这样做<br />http://localhost/?action=SayHello</p>
<hr />
<p><small>© Daniel Wang for <a href="http://www.tairan.net">Tairan&#039;s Story</a>, 2008. |
<a href="http://www.tairan.net/index.php/2008/06/02/the-learning-note-for-fleaphp/">Permalink</a> |
<a href="http://www.tairan.net/index.php/2008/06/02/the-learning-note-for-fleaphp/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.tairan.net/index.php/2008/06/02/the-learning-note-for-fleaphp/&title=FleaPHP 学习笔记 (-)">del.icio.us</a>
<br/>
Post tags: <a href="http://www.tairan.net/index.php/tag/fleaphp/" rel="tag">FleaPHP</a>, <a href="http://www.tairan.net/index.php/tag/php/" rel="tag">PHP</a>, <a href="http://www.tairan.net/index.php/tag/web-framework/" rel="tag">Web Framework</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tairan.net/index.php/2008/06/02/the-learning-note-for-fleaphp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

