<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.nginx.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.nginx.org/index.php?title=PHPFastCGIOnWindows&amp;feed=atom&amp;action=history</id>
		<title>PHPFastCGIOnWindows - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.nginx.org/index.php?title=PHPFastCGIOnWindows&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://wiki.nginx.org/index.php?title=PHPFastCGIOnWindows&amp;action=history"/>
		<updated>2013-06-20T12:11:45Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.0</generator>

	<entry>
		<id>http://wiki.nginx.org/index.php?title=PHPFastCGIOnWindows&amp;diff=296&amp;oldid=prev</id>
		<title>Xiaomao: /* Steps */ No need of cygwin paths, just forward slashes. FIXED all bugs according to Pitfalls. Note that &quot;location ~ \.php$&quot; doesn't have a root!</title>
		<link rel="alternate" type="text/html" href="http://wiki.nginx.org/index.php?title=PHPFastCGIOnWindows&amp;diff=296&amp;oldid=prev"/>
				<updated>2011-07-16T18:53:39Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Steps: &lt;/span&gt; No need of cygwin paths, just forward slashes. FIXED all bugs according to &lt;a href=&quot;/Pitfalls&quot; title=&quot;Pitfalls&quot;&gt;Pitfalls&lt;/a&gt;. Note that &amp;quot;location ~ \.php$&amp;quot; doesn&amp;#039;t have a root!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= php-fcgi on Windows =&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
nginx can interface with PHP on Windows via a FastCGI daemon, which ships with PHP: php-cgi.exe. You need to run '''php-cgi.exe -b 127.0.0.1:&amp;lt;port&amp;gt;''' and use '''[[NginxHttpFcgiModule#fastcgi_pass| fastcgi_pass]]  127.0.0.1:&amp;lt;port&amp;gt;;''' in the nginx configuration file. After being launched, '''php-cgi.exe''' will keep listening for connections in a command prompt window. To hide that window, use the tiny utility [http://redmine.lighttpd.net/attachments/660/RunHiddenConsole.zip RunHiddenConsole]  (the original can be found at http://www.msfn.org/board/index.php?act=ST&amp;amp;f=70&amp;amp;t=49184 but downloading requires signing up for the message board. However, the binaries are identical - md5sum abc6379205de2618851c4fcbf72112eb).&lt;br /&gt;
&lt;br /&gt;
== Steps ==&lt;br /&gt;
* Install [[Install#Win32_Binaries|nginx for win32]]&lt;br /&gt;
* Install the [http://windows.php.net/ Windows binaries of PHP], making sure that php-cgi.exe is installed in the same directory as php.exe.&lt;br /&gt;
* Create somewhere (e.g. in &amp;lt;code&amp;gt;c:\nginx\&amp;lt;/code&amp;gt; a batch file &amp;lt;code&amp;gt;start-php-fcgi.bat&amp;lt;/code&amp;gt; similar to this one:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@ECHO OFF&lt;br /&gt;
ECHO Starting PHP FastCGI...&lt;br /&gt;
set PATH=C:\PHP;%PATH%&lt;br /&gt;
c:\bin\RunHiddenConsole.exe C:\PHP\php-cgi.exe -b 127.0.0.1:9123&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;nginx&amp;quot;&amp;gt;&lt;br /&gt;
root c:/www;&lt;br /&gt;
&lt;br /&gt;
location ~ \.php$ {&lt;br /&gt;
  fastcgi_pass   127.0.0.1:9123;&lt;br /&gt;
  fastcgi_index  index.php;&lt;br /&gt;
  fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;&lt;br /&gt;
  include        fastcgi_params;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autostarting PHP and nginx ==&lt;br /&gt;
&lt;br /&gt;
* Schedule a basic (on Windows Vista) task to run the batch file above at system start up under the SYSTEM account. &lt;br /&gt;
* If using Windows nginx from http://www.kevinworthington.com/nginx-for-windows, schedule a basic (on Windows Vista) task to run '''C:\nginx\conf\start-nginx.bat''' file at system start up under the SYSTEM account in starting directory '''C:\nginx'''. &lt;br /&gt;
* A home made Cygwin build of Nginx can be scheduled using a batch file similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /d C:\cygwin\bin &amp;amp;&amp;amp; bash -c /usr/local/nginx/sbin/nginx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xiaomao</name></author>	</entry>

	</feed>