<?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>Mon, 17 Nov 2008 08:12:01 +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>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>

		<category><![CDATA[Uncategorized]]></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>
		<item>
		<title>40 Firefox Extensions Every Web Developer Should Check Out</title>
		<link>http://blog.stuartherbert.com/php/2008/06/16/40-firefox-extensions-every-web-developer-should-check-out/</link>
		<comments>http://blog.stuartherbert.com/php/2008/06/16/40-firefox-extensions-every-web-developer-should-check-out/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 06:26:29 +0000</pubDate>
		<dc:creator>Stuart Herbert</dc:creator>
		
		<category><![CDATA[1 - Beginner]]></category>

		<category><![CDATA[2 - Intermediate]]></category>

		<category><![CDATA[3 - Advanced]]></category>

		<category><![CDATA[Toolbox]]></category>

		<guid isPermaLink="false">http://blog.stuartherbert.com/php/?p=45</guid>
		<description><![CDATA[
&#8230; as recommended by readers of Planet PHP  
Most Recommendations
There were six Firefox extensions that folks repeatedly recommended &#8230;

ColorZilla - advanced eyedropper, color picker, page zoomer and other colorful goodies.
FireBug - live DOM &#38; CSS inspector.  The single greatest web developer add-on for Firefox.
Live HTTP Headers - view HTTP headers of a page and [...]]]></description>
			<content:encoded><![CDATA[
<p>&#8230; as recommended by readers of <a href="http://www.planet-php.net/">Planet PHP</a> <img src='http://blog.stuartherbert.com/php/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Most Recommendations</h3>
<p>There were six Firefox extensions that folks repeatedly recommended &#8230;</p>
<ol>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/271">ColorZilla</a> - advanced eyedropper, color picker, page zoomer and other colorful goodies.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/1843">FireBug</a> - live DOM &amp; CSS inspector.  The single greatest web developer add-on for Firefox.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/3829">Live HTTP Headers</a> - view HTTP headers of a page and whilst browsing.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/60">Web Developer Toolbar</a> - adds a menu and a toolbar with various web developer tools.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/5369">YSlow</a> - Yahoo&#8217;s tool for analysing web pages and telling you why they are slow.  Requires Firebug.</li>
<li>Zend Studio Toolbar - debugging assistance for Zend Studio 5.5 and earlier.  Isn&#8217;t mentioned on the <a href="http://www.zend.com/en/products/studio/features">Zend Studio 6 pages</a>, so does that mean it is now obsolete?</li>
</ol>
<p>&#8230; and after that, there was a lot of variety amongst the other extensions that were recommended.</p>
<h3>Also Recommended</h3>
<ol>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/1881">Cache Status</a> - easy cache status &amp; management from the status bar.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/16">ChatZilla</a> - IRC client for Firefox.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/28">Duplicate Tab</a> - clone a tab along with its history.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/4510">Edit Cookies</a> - edit your cookies right in Firefox.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/1269">Fasterfox</a> - performance and network tweaks for Firefox.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/5809">Firefox Accessibility Extension</a> - test your web pages for functional accessibility features based on the <a href="http://html.cita.uiuc.edu">iCITA HTML Best Practices</a>.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/6149">FirePHP</a> - print to your Firebug console using a simple PHP function call.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/5648">FireShot</a> - take screenshots of web pages, and a whole lot more.</li>
<li><a href="http://www.google.com/tools/firefox/toolbar/FT3/intl/en/index.html">Google Toolbar</a> - Google&#8217;s famous in-browser search toolbar.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/748">GreaseMonkey</a> - customise the way a web page displays using your own Javascript add-ons.  See also <a href="http://lifehacker.com/software/greasemonkey/lh-top-10-greasemonkey-user-scripts-249957.php">Lifehacker&#8217;s Top 10 Greasemonkey User Scripts</a>, and their <a href="http://lifehacker.com/software/gmail/lifehacker-code-better-gmail-firefox-extension-251923.php">Better GMail</a> and <a href="http://lifehacker.com/software/lifehacker-code/upgrade-flickr-with-the-better-flickr-firefox-extension-263985.php">Better Flickr</a> add-ons to get an idea of just what can be done with <a href="http://lifehacker.com/software/greasemonkey/turn-your-greasemonkey-scripts-into-firefox-extensions-164741.php">Greasemonkey as a Firefox extension tool</a>.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/249">HTML Validator</a> - add HTML validation to your browser.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/1419">IE Tab</a> (Windows only) - open Firefox tabs using IE&#8217;s rendering engine.  See also the popular <a href="https://addons.mozilla.org/en-US/firefox/addon/35">IE View</a> alternative.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/4014">LocationBar2</a> - adds additional features to Firefox&#8217;s address bar.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/2064">Lorem Ipsum content generator</a> - Generate <a href="http://www.lipsum.com/">&#8220;Lorem Ipsum&#8221; dummy text</a>, for when you need to fill a page with content for testing purposes.  </li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/539">MeasureIt</a> - draw out a ruler to get the pixel width and height of any element on the web page.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/3607">NagiosChecker</a> - see the status of your services and servers in Firefox&#8217;s status bar.  You do monitor your servers, right? <img src='http://blog.stuartherbert.com/php/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </li>
<li><a href="http://prefbar.mozdev.org/">PrefBar</a> - power user toolbar for Firefox.  </li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/2077">Regular Expressions Tester</a> - testing tool for regular expressions with colour highlighting.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/4513">RefSpoof</a> - easy spoofing of the HTTP referrer header.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/115">ReloadEvery</a> - reloads a web page every so many seconds.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/4199">Save Session</a> - save your current browser windows &amp; tabs for the next time you open Firefox.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/427">Scrapbook</a> - save web pages locally and easily manage collections.  (Like OS X web archives, as supported by <a href="http://reinventedsoftware.com/together/">Together</a>, <a href="http://www.devon-technologies.com/products/devonthink/">DevonThink</a>, and so on, but cross-platform).</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/2079">Selenium IDE</a> - record, edit and debug tests for <a href="http://www.openqa.org/selenium-rc/">Selenium</a>, the automated UI testing tool for web developers.  See also <a href="http://www.phpunit.de/pocket_guide/3.2/en/selenium.html">PHPUnit&#8217;s support for Selenium</a>.  You do have reproducible testing for you web apps, right? <img src='http://blog.stuartherbert.com/php/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/2108">Stylish</a> - fix ugly sites, customise the look of your browser or mail client by using your own CSS files.  Stylish is to CSS what Greasemonkey is to Javascript.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/1122">Tab Mix Plus</a> - tab management on steroids.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/966">Tamper Data</a> - view and modify HTTP/HTTPS headers and POST parameters.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/2058">TimestampDecode</a> - treats the selected number as a timestamp and displays a decoded date/time.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/57">TitlebarTweaks</a> - tweak Firefox&#8217;s titlebar text.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/59">User Agent Switcher</a> - Adds a menu and a toolbar button to switch the user agent of the browser.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/216">Venkman</a> - Javascript debugger for Firefox.</li>
</ol>
<h3>Stu&#8217;s Recommends</h3>
<p>To round off the list, here are a few extensions that I find useful, but which weren&#8217;t recommended.  If you haven&#8217;t heard of these before, give them a try.</p>
<ol>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/5791">Flagfox</a> - display a country flag in the status bar for the location of the current website&#8217;s server.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/2409">Server Switcher</a> - easily switch between development and production servers.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/4530">Show MyIP</a> - display your current external IP address. </li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/5817">SQLite Manager</a> - Manage any SQLIte database on your computer.</li>
</ol>
<p>Are you a web developer?  Got a favourite Firefox extension that isn&#8217;t on this list?  Let us know in the comments below.</p>
<p class="akst_link"><a href="http://blog.stuartherbert.com/php/?p=45&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_45" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://blog.stuartherbert.com/php/2008/06/16/40-firefox-extensions-every-web-developer-should-check-out/feed/</wfw:commentRss>
		</item>
		<item>
		<title>What Firefox Extensions Should Every Web Developer Have Installed?</title>
		<link>http://blog.stuartherbert.com/php/2008/06/11/what-firefox-extensions-should-every-web-developer-have-installed/</link>
		<comments>http://blog.stuartherbert.com/php/2008/06/11/what-firefox-extensions-should-every-web-developer-have-installed/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 12:21:43 +0000</pubDate>
		<dc:creator>Stuart Herbert</dc:creator>
		
		<category><![CDATA[Toolbox]]></category>

		<guid isPermaLink="false">http://blog.stuartherbert.com/php/?p=44</guid>
		<description><![CDATA[
When it comes to web development, there&#8217;s no doubt that Firefox is king.  What makes it king is the large collection of third-party extensions available for it.  These days, just about everyone has heard about Firebug, but what other extensions would you recommend to folks who do web development?
Share This
]]></description>
			<content:encoded><![CDATA[
<p>When it comes to web development, there&#8217;s no doubt that Firefox is king.  What makes it king is the large collection of third-party extensions available for it.  These days, just about everyone has heard about Firebug, but what other extensions would you recommend to folks who do web development?</p>
<p class="akst_link"><a href="http://blog.stuartherbert.com/php/?p=44&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_44" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://blog.stuartherbert.com/php/2008/06/11/what-firefox-extensions-should-every-web-developer-have-installed/feed/</wfw:commentRss>
		</item>
		<item>
		<title>On Management, False Sirens, And The Threat of Rails</title>
		<link>http://blog.stuartherbert.com/php/2008/06/06/on-management-false-sirens-and-the-threat-of-rails/</link>
		<comments>http://blog.stuartherbert.com/php/2008/06/06/on-management-false-sirens-and-the-threat-of-rails/#comments</comments>
		<pubDate>Fri, 06 Jun 2008 18:10:31 +0000</pubDate>
		<dc:creator>Stuart Herbert</dc:creator>
		
		<category><![CDATA[Opinion]]></category>

		<category><![CDATA[PHP In Business]]></category>

		<guid isPermaLink="false">http://blog.stuartherbert.com/php/?p=43</guid>
		<description><![CDATA[
The motivation for this blog post came from reading an article today touting the meme that cloud computing is coming.  That&#8217;s the message from Sarah Perez over on Read/Write Web.  The &#8220;classic geek&#8221; (which presumably includes many of the folks reading this on Planet PHP) will no longer be the ones  &#8221;working with the CEOs [...]]]></description>
			<content:encoded><![CDATA[
<p>The motivation for this blog post came from reading an article today touting the meme that cloud computing is coming.  That&#8217;s <a href="http://feeds.feedburner.com/~r/readwriteweb/~3/306123006/it_20_changing_technology_and_business_impact.php">the message from Sarah Perez</a> over on Read/Write Web.  The &#8220;classic geek&#8221; (which presumably includes many of the folks reading this on Planet PHP) will no longer be the ones  &#8221;working with the CEOs to execute the vision and direction via information technology,&#8221; according to Sarah.</p>
<p>Presumably because the companies will have gone bust from a lack of good leadership.  Something we&#8217;ve seen before, and will see again.</p>
<p>The successful IT departments in the sort of larger organisations that can provide food and shelter for your true &#8220;classic geek&#8221; have been part of the business for the last decade, if not longer.  Before we had the sexy CTO and CIO titles, there were IT Managers and Operations Managers who did all this stuff with little fan-fare and trumpet blowing.  They did it on a budget, so they had to have financial management skills.  They managed staff, so they had to have people skills.  They delivered results, so they had to have project management skills.  They made sure the business could do its job, so they had to have quality assurance skills.  They implemented approaches such as ITIL and more lately CoBIT to ensure that the IT department was aligned to the business and relevant regulation.  And they did this whilst still groking computers.  In fact, they did this because they groked computers.</p>
<p>I&#8217;ve seen this sort of nonsense before when Java came on the scene, and the rise of the Web 2.0 blogger means I&#8217;m seeing it again.  &#8221;Everything is new, everything is different; the old skills and the old lessons no longer apply, so don&#8217;t bother learning them&#8221; - that is the seductive siren call.  Any student of management history can trace this echo back hundreds if not thousands of years.  The core skills of good governance - direction, organisation and supervision - have not changed.  You can read the works of Confucius from over two thousand years ago, and the principles behind the lessons for the leaders of the time are no different than the principles behind the lessons for the leaders of today.  Practices have changed, but not principles.</p>
<p>There are no secrets, no short-cuts for those-in-the-know; not in business, engineering, or the arts.  You have to know the basics, and you have to do the basics.  Hard work and dedication is always the key, and you won&#8217;t find a single leading member of the PHP development team who doesn&#8217;t reflect that reality.</p>
<p>So what does this have to do with our favourite punch-bag here on Planet PHP, Ruby on Rails?  For me, the rallying call of Rails is different from the Java and Web 2.0 hype/bullshit machines.  I cringe every time Terry takes a swipe at it.  Whilst I&#8217;m as sick of the term &#8216;agile&#8217; as can be, Rails doesn&#8217;t try to claim that the old skills don&#8217;t matter.  Quite the opposite.  What they have done is to take the old skills and put them into one approach that can, and does, really work exceptionally well for a lot of firms and a lot of problems.  They&#8217;ve worked out what the basics are, and they&#8217;ve designed a whole paradigm that ensures the basics are done well.  They&#8217;ve executed in a way that the PHP community should be in awe of, not taking the piss out of.</p>
<p>They are years ahead of us in so many important areas, and yet PHP is thriving more than ever.  They must have done something wrong, because they sure didn&#8217;t grow the market for web applications.  What did they do wrong?</p>
<p>The fundamental mistake the Rails designers have made, and one that they still haven&#8217;t groked en-mass that I can see, is architectural, not philosophical.  Rails is a classic application server, with all the deterministic, concurrency and big-iron-needed-here problems that stopped J2EE from squeezing out PHP at the turn of the century.  For many of the problems of the web, the PHP execute-again architecture has repeatedly been proven to be superior to the application server architecture.  </p>
<ul>
<li>PHP is easier for average-skilled folks to deploy.  What&#8217;s the point of creating applications if you can&#8217;t figure out how to run them anywhere but your bedroom?</li>
<li>It is easier to track down and eliminate bugs in PHP applications.  No persistent processes mean that PHP applications are deterministic.  PHP code is also much simpler to work through and debug.</li>
<li>It is easier to scale applications written in PHP.  Folks have done it, and other folks have repeated it.  The Rails community as yet has not.  </li>
<li>It may be quicker to create applications in Rails, but the operational costs once the application goes into production quickly erode that advantage.  If you&#8217;re not in the US, servers cost real money, and application servers need more iron than the equivalent PHP code.</li>
</ul>
<p>The Agile community likes to talk about &#8220;smells&#8221;, so how come they don&#8217;t see something like mod_rails and gag on the stench of trying to mask architectural failings with such cleverness?</p>
<p>Before I make it onto Terry&#8217;s Christmas card list, I should state that I firmly believe that Ruby itself is a programming language that is vastly superior to PHP, especially when you get away from Apache and are creating the behind-the-scenes plumbing required.  The OO in Rails continues to leave PHP for dead, and OO brings many advantages to a thriving development community.  There are real advantages to being able to share code between both the must-be-real-time web front-end and the non-real time backends, and to be able to easily reuse whatever external open-source libraries save you time and effort.  And I believe that solutions such as the Ruby gems are vastly superior to PEAR and PECL.  PEAR/PECL should have been our CPAN, or our RubyForge.  They deliberately chose not to be, wrongly believing that CPAN was a negative feature of Perl.  They believed that one high-quality solution would prove the superior model over time.  They failed to execute, and the paradigm was plain wrong in the first place.</p>
<p>My prediction is that a Rails-like framework, but built using a PHP-style mod_ruby and execute-again architecture, would have a real chance at displacing PHP.  RoR the application server hasn&#8217;t a snowball&#8217;s chance in hell of achieving that.  Their market firmly remains the same market that .NET and Java already fight over, and it&#8217;s a market they&#8217;re very welcome to.</p>
<p class="akst_link"><a href="http://blog.stuartherbert.com/php/?p=43&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_43" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://blog.stuartherbert.com/php/2008/06/06/on-management-false-sirens-and-the-threat-of-rails/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
