<?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>effective life plus &#187; nginx</title>
	<atom:link href="http://www.binzywu.com/tag/nginx/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.binzywu.com</link>
	<description>Binzy&#039;s blog</description>
	<lastBuildDate>Thu, 17 Jun 2010 00:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>nginx + Zend Framework @ Windows</title>
		<link>http://www.binzywu.com/2009/10/nginx-zend-framework-windows/</link>
		<comments>http://www.binzywu.com/2009/10/nginx-zend-framework-windows/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 13:54:32 +0000</pubDate>
		<dc:creator>binzywu</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php-cgi]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[zend framework]]></category>
		<category><![CDATA[ZF]]></category>

		<guid isPermaLink="false">http://www.binzywu.com/?p=82</guid>
		<description><![CDATA[If you feel pretty boring with Apache, just like me, so having a try of nginx might be good idea. Although at most of my time, I&#8217;m using Windows, fortunately, nginx has native Windows build. So my steps might be &#8230; <a href="http://www.binzywu.com/2009/10/nginx-zend-framework-windows/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you feel pretty boring with Apache, just like me, so having a try of nginx might be good idea. Although at most of my time, I&#8217;m using Windows, fortunately, nginx has native Windows build. So my steps might be helpful to you to try nginx on Windows, especially Windows 7.</p>
<p>1. Download nginx and php and install</p>
<ul>
<li><a href="http://nginx.net/">http://nginx.net/</a></li>
<li><a href="http://windows.php.net/download/">http://windows.php.net/download/</a> (I don&#8217;t like the installer)</li>
</ul>
<p>2. Configure nginx and php</p>
<ul>
<li>PHP, no specific configuration, just do what you like to php.ini.</li>
<li>Nginx<br />
<strong>Fast-CGI of php</strong><br />
You can find sample from wiki.nginx.org, <a href="http://wiki.nginx.org/PHPFastCGIOnWindows">http://wiki.nginx.org/PHPFastCGIOnWindows</a>, below works for me.</p>
<pre class="brush:plain">location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9999;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  D:/www/public/$fastcgi_script_name;
            include        fastcgi_params;
        }</pre>
<p><strong>Configure for Zend Framework<br />
</strong>-f and !-f are used for checking whether file exists.</p>
<pre class="brush:plain">        error_page 404 /index.php;

        if (!-f $request_filename) {
            rewrite ^.*$ /index.php last;
            break;
        }</pre>
</li>
</ul>
<p>3. batch script to start and stop nginx + php-cgi</p>
<p>I&#8217;m using <a href="http://www.msfn.org/board/tool-hide-console-command-line-windows-t49184.html&amp;t=49184" target="_blank">RunHiddenConsole</a> to hide the prompt window and actually you also can use vbs to run nginx.</p>
<p>start-nginx.bat</p>
<pre class="brush:plain">@ECHO OFF
ECHO Starting PHP FastCGI...
C:\nginx\RunHiddenConsole.exe C:\PHP5\php-cgi.exe -b 127.0.0.1:9999
ECHO Starting nginx...
C:\nginx\RunHiddenConsole.exe c:\nginx\nginx.exe</pre>
<p>stop-nginx.bat</p>
<pre class="brush:plain">@ECHO OFF
ECHO Stopping nginx...
taskkill /F /IM nginx.exe
ECHO Stopping php-cgi...
taskkill /F /IM php-cgi.exe</pre>
<p>but php-pfm doesn&#8217;t work on Windows unless you are using cygwin.</p>
<p><img class="alignnone size-medium wp-image-90" title="nginx_zend" src="http://www.binzywu.com/wp-content/uploads/2009/10/nginx_zend-300x125.jpg" alt="nginx_zend" width="300" height="125" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.binzywu.com/2009/10/nginx-zend-framework-windows/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
