<?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>kb.hurricane-ridge.com &#187; php</title>
	<atom:link href="http://kb.hurricane-ridge.com/tag/php/feed" rel="self" type="application/rss+xml" />
	<link>http://kb.hurricane-ridge.com</link>
	<description>My personal - but public - knowledge base</description>
	<lastBuildDate>Tue, 31 Aug 2010 22:18:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Bookmarks for August 25, 2009 through August 27, 2009</title>
		<link>http://kb.hurricane-ridge.com/links/bookmarks-for-august-25-2009-through-august-27-2009</link>
		<comments>http://kb.hurricane-ridge.com/links/bookmarks-for-august-25-2009-through-august-27-2009#comments</comments>
		<pubDate>Fri, 04 Sep 2009 02:49:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Links]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://kb.hurricane-ridge.com/?p=600</guid>
		<description><![CDATA[Links for August 25, 2009 through August 27, 2009:

16 Cheat Sheets on 16 Essential Topics for Web Designers &#124; Pro Blog Design &#8211; &#34;Here are the list of some of the most essential cheat sheets every web developer and designer should have.&#34;

]]></description>
			<content:encoded><![CDATA[<p>Links for August 25, 2009 through August 27, 2009:</p>
<ul>
<li><a href="http://www.problogdesign.com/resources/16-cheat-sheets-on-16-essential-topics-for-web-designers/">16 Cheat Sheets on 16 Essential Topics for Web Designers | Pro Blog Design</a> &#8211; &quot;Here are the list of some of the most essential cheat sheets every web developer and designer should have.&quot;</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://kb.hurricane-ridge.com/links/bookmarks-for-august-25-2009-through-august-27-2009/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running Nginx with PHP via FastCGI</title>
		<link>http://kb.hurricane-ridge.com/applications/running-nginx-with-php-via-fastcgi</link>
		<comments>http://kb.hurricane-ridge.com/applications/running-nginx-with-php-via-fastcgi#comments</comments>
		<pubDate>Mon, 19 Jan 2009 19:52:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[fastcgi]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://kb.hurricane-ridge.com/?p=172</guid>
		<description><![CDATA[Build a default Nginx install; I used the following configure arguments, but these are not necessary for using PHP/FastCGI (only for my environment):
./configure --prefix=/opt/nginx-0.6.34 --user=apache --group=apache
Build PHP for FastCGI, with the following configure arguments:
./configure  --prefix=/opt/php-5.2.8 --enable-fastcgi --enable-force-cgi-redirect --with-gd --with-mysqli --enable-mbstring
--enable-fastcgi --enable-force-cgi-redirect are the important arguments to configure; the others are simply needed for my environment.
Use [...]]]></description>
			<content:encoded><![CDATA[<p>Build a default Nginx install; I used the following <code>configure</code> arguments, but these are not necessary for using PHP/FastCGI (only for my environment):</p>
<pre>./configure --prefix=/opt/nginx-0.6.34 --user=apache --group=apache</pre>
<p>Build PHP for FastCGI, with the following <code>configure</code> arguments:</p>
<pre>./configure  --prefix=/opt/php-5.2.8 --enable-fastcgi --enable-force-cgi-redirect --with-gd --with-mysqli --enable-mbstring</pre>
<p><code>--enable-fastcgi --enable-force-cgi-redirect</code> are the important arguments to <code>configure</code>; the others are simply needed for my environment.</p>
<p>Use the following script to start the PHP FastCGI processes, adapted from <a href="http://blog.kovyrin.net/2006/05/30/nginx-php-fastcgi-howto/">Nginx With PHP As FastCGI Howto</a>:</p>
<pre>
#!/bin/bash

## ABSOLUTE path to the PHP binary
PHPFCGI="/opt/php/bin/php-cgi"

## tcp-port to bind on
FCGIPORT="8888"

## IP to bind on
FCGIADDR="127.0.0.1"

## IP address to accept connections from:
FCGI_WEB_SERVER_ADDRS=127.0.0.1

## number of PHP children to spawn
PHP_FCGI_CHILDREN=4

## number of request before php-process will be restarted
PHP_FCGI_MAX_REQUESTS=1000

# allowed environment variables sperated by spaces
ALLOWED_ENV="PATH USER"

## if this script is run as root switch to the following user
USERID=apache

################## no config below this line

if test x$PHP_FCGI_CHILDREN = x; then
  PHP_FCGI_CHILDREN=5
fi

ALLOWED_ENV="$ALLOWED_ENV PHP_FCGI_CHILDREN"
ALLOWED_ENV="$ALLOWED_ENV PHP_FCGI_MAX_REQUESTS"
ALLOWED_ENV="$ALLOWED_ENV FCGI_WEB_SERVER_ADDRS"

if test x$UID = x0; then
  EX="/bin/su -m -c \"$PHPFCGI -q -b $FCGIADDR:$FCGIPORT\" $USERID"
else
  EX="$PHPFCGI -b $FCGIADDR:$FCGIPORT"
fi

echo $EX

# copy the allowed environment variables
E=

for i in $ALLOWED_ENV; do
  E="$E $i=${!i}"
done

# clean environment and set up a new one
nohup env - $E sh -c "$EX" &#038;> /dev/null &#038;</pre>
<p>I found it necessary to add the <code>FCGI_WEB_SERVER_ADDRS</code> variable to avoid errors similar to the following from the PHP processes (visible by not redirecting output to <code>/dev/null</code> in the last line of the script):</p>
<pre>Connection from disallowed IP address '127.0.0.1' is dropped.</pre>
<p>The <code>nginx.conf</code> file is modified as follows (for a <code>/var/www/html</code> webroot):</p>
<pre>
        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php$ {
            root           /var/www/html;
            fastcgi_pass   127.0.0.1:8888;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /var/www/html$fastcgi_script_name;
            include        fastcgi_params;
        }
</pre>
<p>Additional references: <a href="http://wiki.codemongers.com/Main">Nginx English Wiki</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kb.hurricane-ridge.com/applications/running-nginx-with-php-via-fastcgi/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Suexec&#8217;ed PHP-FastCGI on Apache2</title>
		<link>http://kb.hurricane-ridge.com/applications/suexeced-php-fastcgi-on-apache2</link>
		<comments>http://kb.hurricane-ridge.com/applications/suexeced-php-fastcgi-on-apache2#comments</comments>
		<pubDate>Tue, 30 Dec 2008 20:38:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[fastcgi]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[suexec]]></category>

		<guid isPermaLink="false">http://kb.hurricane-ridge.com/?p=66</guid>
		<description><![CDATA[Code Snippets has an example post on how to do Suexec&#8217;ed PHP-FastCGI on Apache2.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.bigbold.com/snippets/">Code Snippets</a> has an example post on how to do <a href="http://www.bigbold.com/snippets/posts/show/81">Suexec&#8217;ed PHP-FastCGI on Apache2</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://kb.hurricane-ridge.com/applications/suexeced-php-fastcgi-on-apache2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
