<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss 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" version="2.0">

<channel>
	<title>Stuart Herbert On PHP</title>
	
	<link>http://blog.stuartherbert.com/php</link>
	<description>Stuart Herbert's PHP Blog - Architecture, Code, and Hosting</description>
	<pubDate>Wed, 17 Dec 2008 19:01:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/stuartherbert/php" type="application/rss+xml" /><item>
		<title>Making IIS Practical In Production For PHP</title>
		<link>http://blog.stuartherbert.com/php/2008/12/17/making-iis-practical-in-production-for-php/</link>
		<comments>http://blog.stuartherbert.com/php/2008/12/17/making-iis-practical-in-production-for-php/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 19:01:30 +0000</pubDate>
		<dc:creator>Stuart Herbert</dc:creator>
		
		<category><![CDATA[3 - Advanced]]></category>

		<guid isPermaLink="false">http://blog.stuartherbert.com/php/?p=75</guid>
		<description><![CDATA[
I was just reading Derick&#8217;s post about the recent get together with Microsoft, and it occurred to me that so far, I haven&#8217;t seen anyone mention anything about the single most important problem with running PHP in production on IIS.  After a bit of digging, it looks like the problem has been sorted since the [...]]]></description>
			<content:encoded><![CDATA[
<p>I was just reading <a href="http://derickrethans.nl/microsoft_web_developer_summit_wrapup.php">Derick&#8217;s post about the recent get together with Microsoft</a>, and it occurred to me that so far, I haven&#8217;t seen anyone mention anything about the single most important problem with running PHP in production on IIS.  After a bit of digging, it looks like the problem has been sorted since the initial IIS 7 release (presumably, if you&#8217;re still running Windows Server 2003, you&#8217;re still screwed on this one), but I&#8217;d love to hear from folks who have definitely done this in production.</p>
<p>Let me explain the background first.  When you run PHP apps using IIS, you&#8217;re much better off using IIS&#8217;s native CGI support (slow, but rock-solid as of Windows Server 2003 SP1) or the new FastCGI support that was released last year or the year before (faster, but I haven&#8217;t tested it personally under serious stress, as I&#8217;ve managed to move back to working exclusively on Linux this year).  I&#8217;ve tried PHP via IIS&#8217;s ISAPI interface, but as that requires running PHP in a threaded environment, I&#8217;ve never had any luck in getting it working in a stable manner over the years.  Besides, iirc, both Microsoft and Zend recommend running PHP using FastCGI on IIS anyways.</p>
<p>Running PHP via CGI and FastCGI means that IIS has to do the Windows equivalent of fork()ing off PHP processes to do the actual PHP bit.  If your box has too many PHP processes running, the box will start to swap.  Once a webserver starts swapping, you&#8217;ve no chance in hell of keeping up with all the incoming requests, and your websites on that particular webserver become unavailable in a matter of moments.  Restarting IIS will clear off all the PHP processes, but if demand remains the same, the webserver will start swapping again very soon and you&#8217;re back to square one - your websites back to being unavailable to the outside world.</p>
<p>With Apache and mpm-prefork, mpm-peruser or mpm-itk, you can adjust Apache&#8217;s settings to make sure that your server never swaps.  With Apache and PHP/FastCGI, you can do this too by adjusting the number of FastCGI processes created.  (Although, atm, I don&#8217;t recommend using Apache + PHP/FastCGI in production environments).</p>
<p>But how, exactly, do you do this with IIS and PHP/CGI or PHP/FastCGI?  The answer can be found in <a href="http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-70/">the IIS 7 documentation</a>.  It looks like you can limit the number of FastCGI instances per application pool (IIS best practice is to setup a separate application pool per website.  IIS&#8217;s architecture is nothing like Apache).  That&#8217;s fine for servers running just the one website, but is there a way to set a similar limit that applies across all application pools?  It would be great if there was.  And I&#8217;m not sure that there&#8217;s a way to do this with CGI, if you have problems with FastCGI crashing.</p>
<p>Love it or hate it, Windows Server is the right choice for many firms, and the better PHP runs in a Windows Server production environment, the more opportunities there are for firms and individuals that create PHP apps in the future.</p>
<p class="akst_link"><a href="http://blog.stuartherbert.com/php/?p=75&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_75" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://blog.stuartherbert.com/php/2008/12/17/making-iis-practical-in-production-for-php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Job Vacancies at Gradwell</title>
		<link>http://blog.stuartherbert.com/php/2008/12/15/job-vacancies-at-gradwell/</link>
		<comments>http://blog.stuartherbert.com/php/2008/12/15/job-vacancies-at-gradwell/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 14:21:45 +0000</pubDate>
		<dc:creator>Stuart Herbert</dc:creator>
		
		<category><![CDATA[News]]></category>

		<category><![CDATA[PHP In Business]]></category>

		<guid isPermaLink="false">http://blog.stuartherbert.com/php/?p=72</guid>
		<description><![CDATA[
I&#8217;m currently looking to fill two new vacancies at our office in Bath.  I&#8217;m looking for a Senior Sysadmin (permie) and a Storage Engineer (contract) to come in and help us as we grow our award-winning business in 2009.  These roles will be assisting us with our email and hosting platforms.  If you&#8217;re interested, drop [...]]]></description>
			<content:encoded><![CDATA[
<p>I&#8217;m currently looking to fill two new vacancies at our office in Bath.  I&#8217;m looking for a <a href="http://blog.gradwell.net/2008/12/09/senior-systems-administrator/">Senior Sysadmin</a> (permie) and a <a href="http://blog.gradwell.net/2008/12/09/contract-systems-admin-vmware-iscsi/">Storage Engineer</a> (contract) to come in and help us as we grow our <a href="http://blog.gradwell.net/2008/12/12/gradwell-is-best-business-voip-provider/">award-winning business</a> in 2009.  These roles will be assisting us with our email and hosting platforms.  If you&#8217;re interested, drop me an email.  No agencies, please!</p>
<p>Who are we?  Gradwell is a rapidly-growing ISP who focuses on broadband, email, web hosting and VoIP solutions for the UK SME market.  We are a pioneer in VoIP, and are the leading VoIP provider for UK business.  We also do fun things like <a href="http://twittex.com/">Twittex</a>, which I talked about recently at the PHPNW 08 conference.</p>
<p class="akst_link"><a href="http://blog.stuartherbert.com/php/?p=72&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_72" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://blog.stuartherbert.com/php/2008/12/15/job-vacancies-at-gradwell/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHPNW 08 Conference Slides And Photos</title>
		<link>http://blog.stuartherbert.com/php/2008/12/07/phpnw-08-conference-slides-and-photos/</link>
		<comments>http://blog.stuartherbert.com/php/2008/12/07/phpnw-08-conference-slides-and-photos/#comments</comments>
		<pubDate>Sun, 07 Dec 2008 12:01:39 +0000</pubDate>
		<dc:creator>Stuart Herbert</dc:creator>
		
		<category><![CDATA[Conferences]]></category>

		<guid isPermaLink="false">http://blog.stuartherbert.com/php/?p=65</guid>
		<description><![CDATA[
It&#8217;s a bit startling to think that it&#8217;s already a fortnight since the hugely successful PHPNW 08 conference happened up in Manchester.  Where has the last two weeks gone?  (Actually, I know exactly where it&#8217;s gone - putting together a shopping list for new iSCSI storage, but that&#8217;s a different topic).  I thought Jeremy et [...]]]></description>
			<content:encoded><![CDATA[
<p>It&#8217;s a bit startling to think that it&#8217;s already a fortnight since the hugely successful PHPNW 08 conference happened up in Manchester.  Where has the last two weeks gone?  (Actually, I know exactly where it&#8217;s gone - putting together a shopping list for new iSCSI storage, but that&#8217;s a different topic).  I thought Jeremy et al ran a great conference (the single best open-source conference I&#8217;ve been to in the UK so far, and that includes the Gentoo conferences I used to run in Manchester <img src='http://blog.stuartherbert.com/php/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ) and I hope they&#8217;re able to put on another conference next year.  I really enjoyed myself, and I&#8217;d forgotten how much I missed going to conferences.</p>
<p>I was there to talk about our experience at Gradwell with building our <a href="http://twittex.com/">Twittex</a> service in just seven days.  Videos of all the talks will be available from PHPNW once the editing has been finished, but if you can&#8217;t wait, <a href="http://www.slideshare.net/stuartherbert/twittex-from-idea-to-live-in-seven-days-presentation/">my slides are now available</a>.  A big thank you to everyone who provided <a href="http://joind.in/talk/view/88">feedback on the talk</a>.  If you haven&#8217;t done so yet, I&#8217;d love to hear what you thought about the talk.</p>
<p>It takes surgery to separate me from a camera, and the PHPNW 08 weekend was no exception.  This was my first weekend with my new Panasonic DMC-LX 3 (which I bought on the journey up to the conference).  I had great fun putting the camera through its paces, and <a href="http://www.flickr.com/photos/stuartherbert/sets/72157610774343492/">you can see the results up on Flickr</a>.</p>
<p class="akst_link"><a href="http://blog.stuartherbert.com/php/?p=65&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_65" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://blog.stuartherbert.com/php/2008/12/07/phpnw-08-conference-slides-and-photos/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Looking To Meet Folks @ PHPNW Conference</title>
		<link>http://blog.stuartherbert.com/php/2008/11/17/looking-to-meet-folks-phpnw-conference/</link>
		<comments>http://blog.stuartherbert.com/php/2008/11/17/looking-to-meet-folks-phpnw-conference/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 08:12:01 +0000</pubDate>
		<dc:creator>Stuart Herbert</dc:creator>
		
		<category><![CDATA[Conferences]]></category>

		<guid isPermaLink="false">http://blog.stuartherbert.com/php/?p=63</guid>
		<description><![CDATA[
The PHPNW08 conference is almost here.  Things kick off with the social on Friday evening, and the conference proper is on Saturday (Derick&#8217;s keynote starts at 10am).  There are still tickets available according to the conference website.
As well as being there to talk about how we built Twittex in 7 days, I&#8217;m very interested in [...]]]></description>
			<content:encoded><![CDATA[
<p>The <a href="http://conference.phpnw.org.uk/phpnw08/">PHPNW08 conference</a> is almost here.  Things kick off with <a href="http://conference.phpnw.org.uk/phpnw08/?p=412">the social on Friday evening</a>, and the conference proper is on Saturday (Derick&#8217;s keynote starts at 10am).  There are still tickets available according to the conference website.</p>
<p>As well as being there to <a href="http://conference.phpnw.org.uk/phpnw08/?page_id=176">talk about how we built Twittex in 7 days</a>, I&#8217;m very interested in meeting up with folks in the UK who are freelance web developers.  I want to know more about what you want from a web hosting solution, especially what you&#8217;d like to see but can&#8217;t find anywhere in the UK atm.  If that sounds interesting to you, drop me a line before the conference, and we&#8217;ll arrange to meet up during the Friday or Saturday evening socials.</p>
<p>And I&#8217;m also interested in talking to anyone who&#8217;s going to PHPNW08 who&#8217;s interested in building apps for VoIP too.</p>
<p class="akst_link"><a href="http://blog.stuartherbert.com/php/?p=63&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_63" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://blog.stuartherbert.com/php/2008/11/17/looking-to-meet-folks-phpnw-conference/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Advice To A Conference Virgin?</title>
		<link>http://blog.stuartherbert.com/php/2008/10/24/advice-to-a-conference-virgin/</link>
		<comments>http://blog.stuartherbert.com/php/2008/10/24/advice-to-a-conference-virgin/#comments</comments>
		<pubDate>Fri, 24 Oct 2008 16:52:22 +0000</pubDate>
		<dc:creator>Stuart Herbert</dc:creator>
		
		<category><![CDATA[1 - Beginner]]></category>

		<category><![CDATA[Conferences]]></category>

		<guid isPermaLink="false">http://blog.stuartherbert.com/php/?p=60</guid>
		<description><![CDATA[
I&#8217;m speaking at the PHPNW &#8216;08 conference in November, and I&#8217;ve just been contacted for advice by someone understandably excited at going to her very first conference.  Thing is, I&#8217;ve never been a conference newbie (I&#8217;ve always been either speaking or running a conference) so I&#8217;m not the best person to offer advice on this.
What [...]]]></description>
			<content:encoded><![CDATA[
<p>I&#8217;m speaking at the PHPNW &#8216;08 conference in November, and I&#8217;ve just been contacted for advice by someone understandably excited at going to her very first conference.  Thing is, I&#8217;ve never been a conference newbie (I&#8217;ve always been either speaking or running a conference) so I&#8217;m not the best person to offer advice on this.</p>
<p>What would you add to this list?</p>
<ul>
<li>Arrange with on-line friends to meet up either the night before or before the presentations start on the day.</li>
<li>Look for social groups (e.g. PHP Women) you can join before the conference, to see if anyone like-minded is going.</li>
<li>If the conference has more than one presentation going on at once (== multiple tracks), work out in advance which presentations you&#8217;d like to go and see.  You can always change your mind afterwards <img src='http://blog.stuartherbert.com/php/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>Bring a laptop - a lot of the conversation at the conference happens online (such as on Twitter).</li>
<li>Bring a mobile broadband card with you too (do you have mobile broadband outside the UK?), as conference wireless systems can be incredibly unreliable.</li>
<li>Be yourself, but don&#8217;t bullshit - the folks you&#8217;re trying to impress could be prospective customers, work colleagues or employers.</li>
<li>Stay for the after-conference drinks &amp; food, where you can socialise and network.</li>
</ul>
<p class="akst_link"><a href="http://blog.stuartherbert.com/php/?p=60&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_60" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://blog.stuartherbert.com/php/2008/10/24/advice-to-a-conference-virgin/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Can You Secure A Shared Server With PHP + FastCGI?</title>
		<link>http://blog.stuartherbert.com/php/2008/10/07/can-you-secure-a-shared-server-with-php-fastcgi/</link>
		<comments>http://blog.stuartherbert.com/php/2008/10/07/can-you-secure-a-shared-server-with-php-fastcgi/#comments</comments>
		<pubDate>Tue, 07 Oct 2008 08:29:42 +0000</pubDate>
		<dc:creator>Stuart Herbert</dc:creator>
		
		<category><![CDATA[3 - Advanced]]></category>

		<category><![CDATA[The Web Platform]]></category>

		<guid isPermaLink="false">http://blog.stuartherbert.com/php/?p=42</guid>
		<description><![CDATA[
The challenge with securing a shared hosting server is how to secure the website from attack both from the outside and from the inside.  PHP has built-in features to help, but ultimately it’s the wrong place to address the problem.
I&#8217;ve already written about a number of solutions that work, but one option I&#8217;ve been [...]]]></description>
			<content:encoded><![CDATA[
<p><a href="../2007/11/21/the-challenge-with-securing-shared-hosting/">The challenge with securing a shared hosting server</a> is how to secure the website from attack both from the outside and from the inside.  <a href="../2007/11/27/phps-built-in-solutions-for-shared-hosting/">PHP has built-in features to help</a>, but ultimately it’s the wrong place to address the problem.</p>
<p>I&#8217;ve already written about a number of solutions that work, but one option I&#8217;ve been asked time and time again to look at is using PHP + FastCGI.  The belief is that using FastCGI will overcome the performance issues of <a href="http://blog.stuartherbert.com/php/2007/12/18/using-suexec-to-secure-a-shared-server/">Apache&#8217;s suexec</a> or <a href="http://blog.stuartherbert.com/php/2008/01/18/using-suphp-to-secure-a-shared-server/">mod_suphp</a>, because FastCGI processes persist between page views.</p>
<p>But before we can look at performance, the first question is: how exactly do we get PHP and FastCGI running as different users on the one web server in the first place?</p>
<h3>Installing And Configuring mod_fcgid for Apache</h3>
<p>Stock Apache does not ship with built-in support for FastCGI.  You need to download and install a third-party module.  There are two choices - the original <a href="http://www.fastcgi.com/">mod_fastcgi</a>, and the more recent <a href="http://fastcgi.coremail.cn/">mod_fcgid</a>, which I&#8217;ll look at in this article.  Before we start, make sure that you have <a href="http://blog.stuartherbert.com/php/2007/12/18/using-suexec-to-secure-a-shared-server/">built and configured Apache to use suexec</a>.  We will reuse suexec to ensure that our FastCGI PHP processes run as different users.</p>
<p>Most Linux distributions already include a package for mod_fcgid; you should be able to install it using your distro&#8217;s package manage.  The version I&#8217;ve tested for this article is mod_fcgid 2.2 running on Seed Linux (a Gentoo-based distro).</p>
<p>After installing mod_fcgid, make sure that you edit your Apache config files, and comment out any lines that load mod_php.  They will look like this:</p>
<pre>LoadModule php5_module modules/libphp5.so</pre>
<p>Then, add the following lines to your virtual host.</p>
<pre>SuexecUserGroup myuser mygroup

&lt;Directory /var/www/localhost/htdocs&gt;
AddHandler fcgid-script .php
Options ExecCGI
Allow from all
FCGIWrapper /var/www/localhost/cgi-bin/php.fcgi .php
&lt;/Directory&gt;</pre>
<p>Replace &#8220;myuser&#8221; with the user who owns the website, and replace &#8220;mygroup&#8221; with the group that the user belongs to.  This sets the privileges that PHP will run as when this website is visited.</p>
<p>Because suexec is understandably paranoid about what CGI programs it will run for you, to make mod_fcgid work in a shared hosting environment, we need to create a FastCGI wrapper script owned by the same user that owns the website:</p>
<p>#!/bin/bash<br />
PHPRC=/etc/php/apache2-php5<br />
export PHPRC<br />
PHP_FCGI_CHILDREN=4<br />
export PHP_FCGI_CHILDREN<br />
PHP_FGCI_MAX_REQUESTS=5000<br />
export PHP_FCGI_MAX_REQUESTS<br />
exec /usr/lib/php5/bin/php-cgi</p>
<p>Each website needs its own copy of the script.  Place this script in the website&#8217;s dedicated cgi-bin directory.  This should be a directory that you control to make sure that malicious scripts cannot be uploaded to take advantage of suexec.  Make sure that the script is owned by the user and group who owns the website, otherwise suexec will refuse to run the script, and you&#8217;ll spend quite a bit of time scratching your head wondering what the problem is!</p>
<p>The FastCGI wrapper script gives us an opportunity to set limits on how PHP works as a FastCGI process.  We can tell it how many FastCGI scripts are allowed to run (to make sure one website doesn&#8217;t use up all of the web server&#8217;s free capacity), and also how many HTTP requests each FastCGI process should handle before terminating (to limit the impact of memory leaks).</p>
<p>At this point, you can restart Apache, and you should find that your websites are now using suexec + FastCGI to run as separate users.</p>
<h3>Making Apache Go Even Faster</h3>
<p>One of the major benefits of using Apache 2.2 over Apache 1.3 is the ability to switch how Apache works at the fundamental level.  Apache MPMs (multi-processing modules) can emulate Apache 1.3&#8217;s behaviour (mpm-prefork) &#8230; but it can also provide new options.  By default, most (if not all) Linux distributions install Apache 2.2 built with mpm-prefork, but by switching to another MPM, can we make our websites go even faster?</p>
<p>If you are using suexec + mod_fcgid on Linux, there are two MPMs available to you that have the potential to boost performance further: mpm-worker and mpm-event.  Both MPMs turn Apache into a multi-threaded server.  On Linux systems, it is usually much quicker to create new threads than it is to create new processes.  The downside is that software has to be specially written to work correctly in a multi-threaded application (known as being thread-safe).  mod_php doesn&#8217;t work reliably with mpm-worker and mpm-event, because it reuses a lot of third-party code that may or may not be thread-safe.  But because we&#8217;re running PHP in a separate FastCGI process, we can safely turn Apache into a multi-threaded server.</p>
<h3>Some Benchmarks</h3>
<p>To benchmark PHP + FastCGI + suexec, I used Apache’s ab benchmark to load a simple phpinfo() page 1,000 times. I ran the benchmark five times, and averaged the results.  To compare the results, I repeated the tests against mpm-worker, mpm-event, and mpm-prefork both with and without mod_php.</p>
<ul>
<li>mpm-worker + mod_fcgid + PHP/FastCGI + suexec: 7.36 seconds, 0.2% failure rate</li>
<li>mpm-event + mod_fcgid + PHP/FastCGI + suexec: 7.75 seconds, 0.2 % failure rate</li>
<li>mpm-prefork + mod_fcgid + PHP/FastCGI + suexec: 7.92 seconds, 0.2% failure rate</li>
<li>mpm-prefork + mod_fastcgi + PHP/FastCGI + suexec: 8.52 seconds, 0.2% failure rate</li>
<li>mpm-prefork + mod_php: 7.38 seconds, 0% failure rate</li>
</ul>
<h3>Other Considerations</h3>
<p>The performance is good, especially if you switch Apache MPMs.  These benchmarks are extremely simplistic, and what they don&#8217;t show is that switching to mpm-worker and mpm-event will probably speed up your websites even further, because these Apache MPMs handle downloading images more efficiently than mpm-prefork can.  You may also be able to scale your websites better before having to upgrade your servers or add additional ones, especially if you use a bytecode cache such as APC or xcache.</p>
<p>But what are the downsides?</p>
<ul>
<li>As with straight suexec, you can&#8217;t use HTTP authentication in your application.  Hardly any apps rely on this functionality any more (probably because so many shared hosting servers use suexec).</li>
<li>Your server may require extra RAM to cope with the number of FastCGI processes running simultaneously.  You may need to switch to a 32-bit Linux kernel that supports PAE or to a 64-bit Linux distro.</li>
<li>Apache + PHP/FastCGI is not 100% reliable in my testing.</li>
</ul>
<h3>Conclusions</h3>
<p>It is possible to combine PHP, FastCGI and suexec to produce a solution that secures a shared hosting server and at the same time provides good performance compared to the alternatives.  If you&#8217;re prepared to compile Apache from source and switch MPMs, you can squeeze even more performance from this combination, and perhaps even out-perform the venerable mod_php.</p>
<p>Unfortunately, my experience was that the PHP + FastCGI combination cannot be trusted to serve pages 100% of the time.  The average failure rate was 2 requests per 1000, and the failure rate was consistent no matter which Apache MPM was used, which Apache FastCGI module was used, and how many thousands of requests I used in my testing.  At the time of writing, I haven&#8217;t tracked down the cause of this failure, and it may not appear in your own environment, but none of the previous solutions I&#8217;ve looked at in this series have displayed this problem, so it&#8217;s something to think about before chosing PHP + FastCGI to serve your websites.  I&#8217;m hoping to find time in the future to get to the bottom of this problem, if no-one gets there first.</p>
<p>As a result, I can&#8217;t recommend using PHP/FastCGI + suexec at this time.  My current recommendation is mpm-itk, which has successfully served millions of page hits for me in production over the last few months.</p>
<h3>References</h3>
<p>This article was made possible by information already on the internet:</p>
<ul>
<li><a href="http://interworx.com/forums/showthread.php?p=8327">http://interworx.com/forums/showthread.php?p=8327</a></li>
<li><a href="http://ckdake.com/projects/documentation/php_security">http://ckdake.com/projects/documentation/php_security</a></li>
</ul>
<p><em>This article is part of <a href="../series-the-web-platform/">The Web Platform</a>, an on-going series of blog posts about the environment that you need to create and nurture to run your web-based application in. If you have any topics that you’d like to see covered in future articles, <a href="../series-the-web-platform/">please leave them in the comments on this page</a>.</em></p>
<p class="akst_link"><a href="http://blog.stuartherbert.com/php/?p=42&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_42" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://blog.stuartherbert.com/php/2008/10/07/can-you-secure-a-shared-server-with-php-fastcgi/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Tea Leaves</title>
		<link>http://blog.stuartherbert.com/php/2008/10/03/tea-leaves/</link>
		<comments>http://blog.stuartherbert.com/php/2008/10/03/tea-leaves/#comments</comments>
		<pubDate>Fri, 03 Oct 2008 20:26:38 +0000</pubDate>
		<dc:creator>Stuart Herbert</dc:creator>
		
		<category><![CDATA[Opinion]]></category>

		<guid isPermaLink="false">http://blog.stuartherbert.com/php/?p=56</guid>
		<description><![CDATA[
Sigh &#8230; don&#8217;t you just hate it when folks steal your work by re-posting it as if it is theirs? 
Share This
]]></description>
			<content:encoded><![CDATA[
<p>Sigh &#8230; don&#8217;t you just hate it when folks steal your work by re-posting it as if it is theirs? <img src='http://blog.stuartherbert.com/php/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /></p>
<p class="akst_link"><a href="http://blog.stuartherbert.com/php/?p=56&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_56" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://blog.stuartherbert.com/php/2008/10/03/tea-leaves/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Speaking at PHPNW’08</title>
		<link>http://blog.stuartherbert.com/php/2008/09/26/speaking-at-phpnw08/</link>
		<comments>http://blog.stuartherbert.com/php/2008/09/26/speaking-at-phpnw08/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 21:52:56 +0000</pubDate>
		<dc:creator>Stuart Herbert</dc:creator>
		
		<category><![CDATA[Conferences]]></category>

		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://blog.stuartherbert.com/php/?p=54</guid>
		<description><![CDATA[
I&#8217;m really pleased to be speaking at the PHPNW&#8217;08 conference in Manchester on 22nd November.  I&#8217;m going to be giving a behind-the-scenes look at how we built twittex.com in just 7 days from idea to live service at Gradwell dot com, warts and all, and show you what really worked for us, and what we [...]]]></description>
			<content:encoded><![CDATA[
<p>I&#8217;m really pleased to be speaking at the <a href="http://conference.phpnw.org.uk/phpnw08/">PHPNW&#8217;08 conference</a> in Manchester on 22nd November.  I&#8217;m going to be giving a behind-the-scenes look at how we built <a href="http://twittex.com/">twittex.com</a> in <a href="http://blog.stuartherbert.com/php/2008/08/20/twittexcom-launches/">just 7 days from idea to live service</a> at <a href="http://www.gradwell.com/">Gradwell dot com</a>, warts and all, and show you what really worked for us, and what we should have done to deliver the service even quicker.  I&#8217;ll be covering technology, project management, and marketing too.</p>
<p>The last time I spoke at a conference was on Marco&#8217;s first php|cruise back in 2004, where we enjoyed a great <a href="http://www.flickr.com/photos/stuartherbert/182459608/in/set-72157594184288938/">view from the bar</a>.  There wasn&#8217;t really a UK PHP scene back then, so I&#8217;m looking forward to seeing how that&#8217;s changed in the last four years.  We built twittex in-house, but we also outsource PHP development, and I&#8217;m very interested in meeting up with folks offering PHP and symfony development who are interested in VoIP (we&#8217;re the UK&#8217;s third largest VoIP provider) and social apps, and also with anyone interested in integrating VoIP into their apps too.</p>
<p>See you in Manchester in November!</p>
<p class="akst_link"><a href="http://blog.stuartherbert.com/php/?p=54&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_54" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://blog.stuartherbert.com/php/2008/09/26/speaking-at-phpnw08/feed/</wfw:commentRss>
		</item>
		<item>
		<title>twittex.com Launches!</title>
		<link>http://blog.stuartherbert.com/php/2008/08/20/twittexcom-launches/</link>
		<comments>http://blog.stuartherbert.com/php/2008/08/20/twittexcom-launches/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 12:53:16 +0000</pubDate>
		<dc:creator>Stuart Herbert</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.stuartherbert.com/php/?p=50</guid>
		<description><![CDATA[
Last Thursday, twitter was forced to withdraw its free SMS alerts service to UK users.  This was a big blow to us at Gradwell dot com, because we&#8217;d just started using twitter to push out service alerts to our customers.
Six days later, thanks to the power of symfony, PHP, mysql and q4m, we&#8217;ve built and [...]]]></description>
			<content:encoded><![CDATA[
<p>Last Thursday, twitter was forced to withdraw its free SMS alerts service to UK users.  This was a big blow to us at Gradwell dot com, because we&#8217;d just started using twitter to push out service alerts to our customers.</p>
<p>Six days later, thanks to the power of symfony, PHP, mysql and q4m, we&#8217;ve built and launched a replacement service called <a href="http://twittex.com/">twittex.com</a>.  This is a very simple-to-use prepay service that allows you to follow the friends of your choice on the mobile phone of your choice via SMS, and it&#8217;s now live <img src='http://blog.stuartherbert.com/php/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
<p class="akst_link"><a href="http://blog.stuartherbert.com/php/?p=50&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_50" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://blog.stuartherbert.com/php/2008/08/20/twittexcom-launches/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Where Are The Benchmarks For Phar?</title>
		<link>http://blog.stuartherbert.com/php/2008/06/29/where-are-the-benchmarks-for-phar/</link>
		<comments>http://blog.stuartherbert.com/php/2008/06/29/where-are-the-benchmarks-for-phar/#comments</comments>
		<pubDate>Sun, 29 Jun 2008 22:12:18 +0000</pubDate>
		<dc:creator>Stuart Herbert</dc:creator>
		
		<category><![CDATA[Toolbox]]></category>

		<guid isPermaLink="false">http://blog.stuartherbert.com/php/?p=46</guid>
		<description><![CDATA[
Derick recently blogged that &#8220;phar is cool!&#8221;  Cool is great &#8230; but it doesn&#8217;t answer important questions: how does loading your application from a .phar file affect overall performance and scalability?  How well does it work with leading bytecode caches?
Where are the benchmarks for phar? 
Share This
]]></description>
			<content:encoded><![CDATA[
<p><a href="http://derickrethans.nl/friday_afternoon_toying_ez_components_as_phar.php">Derick recently blogged that &#8220;phar is cool!&#8221;</a>  Cool is great &#8230; but it doesn&#8217;t answer important questions: how does loading your application from a .phar file affect overall performance and scalability?  How well does it work with leading bytecode caches?</p>
<p>Where are the benchmarks for phar? <img src='http://blog.stuartherbert.com/php/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
<p class="akst_link"><a href="http://blog.stuartherbert.com/php/?p=46&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_46" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://blog.stuartherbert.com/php/2008/06/29/where-are-the-benchmarks-for-phar/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
