<?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>Mike Willbanks &#187; PHP</title>
	<atom:link href="http://blog.digitalstruct.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.digitalstruct.com</link>
	<description>Getting inside the mind of a php developer.</description>
	<lastBuildDate>Tue, 13 Jul 2010 13:42:32 +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>Getting Started with Nginx and PHP-FPM</title>
		<link>http://blog.digitalstruct.com/2010/07/12/getting-started-with-nginx-and-php-fpm/</link>
		<comments>http://blog.digitalstruct.com/2010/07/12/getting-started-with-nginx-and-php-fpm/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 03:44:25 +0000</pubDate>
		<dc:creator>Mike Willbanks</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.digitalstruct.com/?p=130</guid>
		<description><![CDATA[Nginx, a HTTP and reverse proxy server, known for its blazing speed in serving static files, including grand performance in terms of serving up FastCGI pages makes for a great coupling with the upcoming PHP-FPM sapi in PHP (It is currently in the 5.3 branch and previously was a patch) offer a great solution for [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://nginx.net">Nginx</a>, a HTTP and reverse proxy server, known for its blazing speed in serving static files, including grand performance in terms of serving up FastCGI pages makes for a great coupling with the upcoming <a href="http://php-fpm.org/">PHP-FPM</a> sapi in PHP (It is currently in the 5.3 branch and previously was a patch) offer a great solution for finally getting rid of that old sloppy mod_php in Apache. Do you have the same issue where your apache instances have started to run too large?  This might be the time to start to move forward.</p>
<p>A little background on why I have endeavored on this path. While running Apache at several jobs and institutions it simply became clear that under heavier traffic loads having all of the ridged custom components of Apache were starting to slow things down.  To the point of large instances running sometimes up to 300MB in size.  Having this size just to get a simple image or PHP page was just not necessary as well as proved to be a performance bottleneck.</p>
<p>While the first point of departure is to utilize a faster web server to proxy the existing one, it still does not stand to the point of keeping everything to a single task.  This is where the FastCGI instances of PHP started to come in very useful as well as having something to monitor the processes aka PHP-FPM.</p>
<h2>Updates</h2>
<ul>
<li><em>2010/07/13</em>: I have updated the Nginx configuration to put in place what <a href="http://martinfjordvald.com">Martin Fjordvald</a> had mentioned in <a href="/2010/07/12/getting-started-with-nginx-and-php-fpm/comment-page-1/#comment-40971">his comment</a>.  The fastcgi_params are now far quicker to put in!  Thanks again!.</li>
</ul>
<h2>Overview</h2>
<p>This posting assumes that you are not operating under a shared hosting account and that you have some dedicated hardware, a virtual machine or something in the cloud.  Currently I have just switched from a dedicated server at The Planet to their new cloud offering which reduced my immediate costs substantially (149 to 99 per month for essentially the same thing but even better &#8211; my disk now operates off of a SAN.  To you cloud junkies, you know disk speed / IO wait time is a pain in the a**.  This simply mitigates these types of issues).  Which has allowed me to take some time to move over to Nginx and PHP-FPM without having to have reconfigured my existing machine to what I wanted.</p>
<p>Further, you must be comfortable in running everything under a single user account, this is not something for a shared hosting supplier (while you can accomplish this, it is not why I am writing this post since the security of which, is just terrible).  Simply put, if you have a shared hosting account switch to a VM (cloud hosting is a VM) or a dedicated server.  This may not make some of you happy to hear but there are generally a large amount of issues with shared hosting &#8211; mostly related to security.  But that is another rant&#8230;. Let&#8217;s get started.</p>
<h2>PHP-FPM</h2>
<p>PHP-FPM is a FastCGI process manager for PHP, say goodbye to the spawn-fcgi script from Lighttpd.  The PHP-FPM has additional features that can make it appealing for any crowd.  To name a few:</p>
<ul>
<li>Emergency restart in case of accidental opcode cache destruction</li>
<li>Enhancements to FastCGI, such as fastcgi_finish_request() &#8211; a special function to finish request &#038; flush all data while continuing to do something time-consuming</li>
<li>Ability to start workers with different uid/gid/chroot/environment and different php.ini (replaces safe_mode) &#8211; Covered in the <a href="http://php-fpm.org/wiki/Configuration_File">PHP-FPM workers documentation</a>.</li>
<li>Adaptive process spawning</li>
</ul>
<p>PHP-FPM has been available for quite some time, however, it is new to the PHP 5.3 branch (to date, it has not been in a packaged release from PHP).  There is a bit of configuration that you will need to do with PHP in order to get up and running with PHP-FPM.  If you are afraid of compiling or not using your package managers builds, then you may want to stop reading now.</p>
<h3>PHP 5.3 + PHP-FPM Installation</h3>
<p>Installing PHP 5.3 and including PHP-FPM is simple.  I tend to statically compile many of my extensions into PHP to make maintenance more simple with multiple machines.  However, this is not a necessity.  To get going follow these instructions (if you already have PHP and want to maintain some of your current configuration do a php -i from the command line and grab the configure statement &#8211; excluding apache related configuration (aka apxs).  I&#8217;ve removed most of my configuration from this tutorial.  You may find that you need additional librarys installed (just install them through your package manager).</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>us2.php.net<span style="color: #000000; font-weight: bold;">/</span>get<span style="color: #000000; font-weight: bold;">/</span>php-5.3.2.tar.gz<span style="color: #000000; font-weight: bold;">/</span>from<span style="color: #000000; font-weight: bold;">/</span>www.php.net<span style="color: #000000; font-weight: bold;">/</span>mirror
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-zxf</span> php-5.3.2.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> php-5.3.2
<span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #7a0874; font-weight: bold;">export</span> http:<span style="color: #000000; font-weight: bold;">//</span>svn.php.net<span style="color: #000000; font-weight: bold;">/</span>repository<span style="color: #000000; font-weight: bold;">/</span>php<span style="color: #000000; font-weight: bold;">/</span>php-src<span style="color: #000000; font-weight: bold;">/</span>branches<span style="color: #000000; font-weight: bold;">/</span>PHP_5_3<span style="color: #000000; font-weight: bold;">/</span>sapi<span style="color: #000000; font-weight: bold;">/</span>fpm sapi<span style="color: #000000; font-weight: bold;">/</span>fpm
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> autom4te.cache
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> configure
.<span style="color: #000000; font-weight: bold;">/</span>buildconf <span style="color: #660033;">--force</span>
.<span style="color: #000000; font-weight: bold;">/</span>configure \
<span style="color: #660033;">--with-layout</span>=GNU \
<span style="color: #660033;">--with-libdir</span>=lib64 \
<span style="color: #660033;">--enable-fpm</span> \
<span style="color: #660033;">--with-gd</span> \
<span style="color: #660033;">--enable-mbstring</span> \
<span style="color: #660033;">--enable-pcntl</span> \
<span style="color: #660033;">--enable-soap</span> \
<span style="color: #660033;">--enable-sockets</span> \
<span style="color: #660033;">--enable-sqlite-utf8</span> \
<span style="color: #660033;">--enable-zip</span> \
<span style="color: #660033;">--with-zlib</span> \
<span style="color: #660033;">--with-curl</span> \
<span style="color: #660033;">--with-pcre</span> \
<span style="color: #660033;">--with-jpeg-dir</span> \
<span style="color: #660033;">--with-png-dir</span> \
<span style="color: #660033;">--with-zlib-dir</span> \
<span style="color: #660033;">--with-gettext</span> \
<span style="color: #660033;">--with-mcrypt</span> \
<span style="color: #660033;">--with-mysql</span> \
<span style="color: #660033;">--with-mysqli</span> \
<span style="color: #660033;">--with-pdo-mysql</span> \
<span style="color: #660033;">--with-pdo-sqlite</span> \
<span style="color: #660033;">--with-tidy</span> \
<span style="color: #660033;">--with-pear</span> \
<span style="color: #660033;">--with-xml</span> \
<span style="color: #660033;">--disable-debug</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<h4>Add Your Init Script</h4>
<p>Download the script from: http://svn.php.net/repository/php/php-src/branches/PHP_5_3/sapi/fpm/init.d.php-fpm.in</p>
<p>Now that you have the script, modify it to contain the correct paths.  I am not going to do this here since if you&#8217;re running your own server or virtual machine I feel you should know to do such things <img src='http://blog.digitalstruct.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<h4>Update Your Configuration</h4>
<p>The default may run fine for you, however, it is always best to take a peak at what users are running, your port numbers and ensuring that all of your items are setup the way you want them.  Look for php-fpm.conf under /etc/php-fpm.conf or /usr/local/etc/php-fpm.conf.  Then update this file to your liking.  Once coompleted, start it up: /etc/init.d/php-fpm start &#8211; if you have issues, ensure that your variables are correct and that the configuration lines up with the init script (aka pid file for instance).</p>
<h2>Nginx</h2>
<h3>Installation</h3>
<p>Most of your distributions support nginx.  You can install this through your package manager, however, I prefer to have the most recent versions (and running a redhat based distro that generally requires installing from source or creating a package &#8211; there is no .spec file so I took the easy way out) therefore, I decided to install from source which is a simple task but yet I customized it a bit to exclude a few things I did not need.</p>
<p>Steps that you will need to follow (to some degree):</p>
<ol>
<li>Download Nginx (we&#8217;ll use stable for now)</li>
<li>Extract the Package</li>
<li>Configure, Make and Make Install</li>
</ol>
<p>Just as a note, I generally save my configuration in a shell script to allow for easy upgrading.  You may want to do the same as it will allow you to quickly upgrade rather than attempting to figure out what you&#8217;re configure script was.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>nginx.org<span style="color: #000000; font-weight: bold;">/</span>download<span style="color: #000000; font-weight: bold;">/</span>nginx-0.7.xx.tar.gz <span style="color: #666666; font-style: italic;">#not the real link, find current stable release on 7.x series)</span>
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-zxf</span> nginx-0.7.xx.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> nginx-0.7.xx
.<span style="color: #000000; font-weight: bold;">/</span>configure --with-http_ssl_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-http_stub_status_module
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>So that was easy, or did you take the cheater way out and just install the package (which most are at 0.6)?  Either way, this should still work for you.</p>
<p>Many tutorials (especially the one that I looked at beginning to convert to nginx simply rely on a single index.php &#8211; not that it is an issue but be wary about these tutorials since many of them exhibit issues related to security (one of which, is the first result in Google on a search for: nginx wordpress rewrite).  I&#8217;ll say a little more once we get into the Site portion of the configuration.</p>
<h3>The Main Configuration</h3>
<p>The main configuration file is generally in /etc/nginx/nginx.conf or /usr/local/nginx/conf/nginx.conf.  Here we want to setup a few of our variables to improve the server itself.  There is a great guide from <a href="http://articles.slicehost.com/2009/3/5/ubuntu-intrepid-nginx-configuration">Slicehost on nginx defaults</a>, you may want to get started there.  Now my configuration is based quite a bit off of the Slicehost configuration as well as a few additional changes when we get more into the PHP section.  For reference here is my configuration.</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">user  www-data<span style="color: #666666; font-style: italic;">;</span>
worker_processes  <span style="">4</span><span style="color: #666666; font-style: italic;">;</span>
pid        logs/nginx.pid<span style="color: #666666; font-style: italic;">;</span>
events <span style="">&#123;</span>
    worker_connections  <span style="">1024</span><span style="color: #666666; font-style: italic;">;</span>
<span style="">&#125;</span>
http <span style="">&#123;</span>
    include       mime.types<span style="color: #666666; font-style: italic;">;</span>
    default_type  application/octet-stream<span style="color: #666666; font-style: italic;">;</span>
    server_names_hash_bucket_size <span style="">128</span><span style="color: #666666; font-style: italic;">;</span>
    log_format  main  '$remote_addr - $remote_user <span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>$time_local<span style="">&#93;</span></span> <span style="color: #933;">&quot;$request&quot;</span> '
                      '$status $body_bytes_sent <span style="color: #933;">&quot;$http_referer&quot;</span> '
                      '<span style="color: #933;">&quot;$http_user_agent&quot;</span> <span style="color: #933;">&quot;$http_x_forwarded_for&quot;</span>'<span style="color: #666666; font-style: italic;">;</span>
&nbsp;
    access_log  /var/log/nginx/access.log  main<span style="color: #666666; font-style: italic;">;</span>
    error_log   /var/log/nginx/error.log   debug<span style="color: #666666; font-style: italic;">;</span>
&nbsp;
    sendfile        on<span style="color: #666666; font-style: italic;">;</span>
    tcp_nopush      on<span style="color: #666666; font-style: italic;">;</span>
    tcp_nodelay     off<span style="color: #666666; font-style: italic;">;</span>
&nbsp;
    keepalive_timeout  <span style="">2</span><span style="color: #666666; font-style: italic;">;</span>
&nbsp;
    gzip  on<span style="color: #666666; font-style: italic;">;</span>
    gzip_comp_level <span style="">2</span><span style="color: #666666; font-style: italic;">;</span>
    gzip_proxied any<span style="color: #666666; font-style: italic;">;</span>
    gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript<span style="color: #666666; font-style: italic;">;</span>
&nbsp;
    include /usr/local/nginx/sites-enabled/*<span style="color: #666666; font-style: italic;">;</span>
<span style="">&#125;</span></pre></div></div>

<p>One thing to note, is that due to some of my domain name sizes, I needed to increase the variable &#8220;server_names_hash_bucket_size&#8221; to 128 instead of the current default 32.</p>
<h3>Setting up FastCGI Variables</h3>
<p>These will be needed in order for your installation to work, as well as, setting up your environmental variables that get sent to PHP.  You will notice most of these parameters.</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">; /etc/nginx/fastcgi_params</span>
fastcgi_param  QUERY_STRING       $query_string<span style="color: #666666; font-style: italic;">;</span>
fastcgi_param  REQUEST_METHOD     $request_method<span style="color: #666666; font-style: italic;">;</span>
fastcgi_param  CONTENT_TYPE       $content_type<span style="color: #666666; font-style: italic;">;</span>
fastcgi_param  CONTENT_LENGTH     $content_length<span style="color: #666666; font-style: italic;">;</span>
fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name<span style="color: #666666; font-style: italic;">;</span>
fastcgi_param  PATH_INFO $fastcgi_script_name<span style="color: #666666; font-style: italic;">;</span>
&nbsp;
fastcgi_param  SCRIPT_NAME        $fastcgi_script_name<span style="color: #666666; font-style: italic;">;</span>
fastcgi_param  REQUEST_URI        $request_uri<span style="color: #666666; font-style: italic;">;</span>
fastcgi_param  DOCUMENT_URI       $document_uri<span style="color: #666666; font-style: italic;">;</span>
fastcgi_param  DOCUMENT_ROOT      $document_root<span style="color: #666666; font-style: italic;">;</span>
fastcgi_param  SERVER_PROTOCOL    $server_protocol<span style="color: #666666; font-style: italic;">;</span>
&nbsp;
fastcgi_param  GATEWAY_INTERFACE  CGI/<span style="">1.1</span><span style="color: #666666; font-style: italic;">;</span>
fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version<span style="color: #666666; font-style: italic;">;</span>
&nbsp;
fastcgi_param  REMOTE_ADDR        $remote_addr<span style="color: #666666; font-style: italic;">;</span>
fastcgi_param  REMOTE_PORT        $remote_port<span style="color: #666666; font-style: italic;">;</span>
fastcgi_param  SERVER_ADDR        $server_addr<span style="color: #666666; font-style: italic;">;</span>
fastcgi_param  SERVER_PORT        $server_port<span style="color: #666666; font-style: italic;">;</span>
fastcgi_param  SERVER_NAME        $server_name<span style="color: #666666; font-style: italic;">;</span></pre></div></div>

<p>Now in that same file, you may want to also include some additional <a href="http://wiki.nginx.org/NginxHttpFcgiModule">fastcgi configuration</a>.  These will likely need to be tuned for your environment and may take a little trial and error until you find the best fit.</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">fastcgi_connect_timeout <span style="">60</span><span style="color: #666666; font-style: italic;">;</span>
fastcgi_send_timeout <span style="">180</span><span style="color: #666666; font-style: italic;">;</span>
fastcgi_read_timeout <span style="">180</span><span style="color: #666666; font-style: italic;">;</span>
fastcgi_buffer_size 128k<span style="color: #666666; font-style: italic;">;</span>
fastcgi_buffers <span style="">4</span> 256k<span style="color: #666666; font-style: italic;">;</span>
fastcgi_busy_buffers_size 256k<span style="color: #666666; font-style: italic;">;</span>
fastcgi_temp_file_write_size 256k<span style="color: #666666; font-style: italic;">;</span>
fastcgi_intercept_errors on<span style="color: #666666; font-style: italic;">;</span></pre></div></div>

<h3>Setting up your First Site</h3>
<p>Let&#8217;s configure a simple default site that just processes PHP scripts.  No real hard trouble here!  Create a new file in the sites-enabled directory called default.conf.  We are going to have it parse our /var/www/default directory (if you do not have one, create one and add an index.php file of some sort in there). Here is a quick and simple configuration to get started:</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">server <span style="">&#123;</span>
        listen <span style="">80</span> default<span style="color: #666666; font-style: italic;">;</span>
&nbsp;
        root   /var/www/default/public<span style="color: #666666; font-style: italic;">;</span>
        index index.php<span style="color: #666666; font-style: italic;">;</span>
&nbsp;
        location ~ \.php$ <span style="">&#123;</span>
                include /usr/local/nginx/conf/fastcgi_params<span style="color: #666666; font-style: italic;">;</span>
                fastcgi_index index.php<span style="color: #666666; font-style: italic;">;</span>
                if <span style="">&#40;</span>-f $request_filename<span style="">&#41;</span> <span style="">&#123;</span>
                    fastcgi_pass 127.0.0.1:<span style="">9000</span><span style="color: #666666; font-style: italic;">;</span>
                <span style="">&#125;</span>
        <span style="">&#125;</span>
<span style="">&#125;</span></pre></div></div>

<p>Note the location ~ \.php$, this tells us that for every PHP file to push it into fastcgi, now if you parse additional extensions through PHP, for the sake of everything, please add extensions to the location!  Otherwise your precious PHP files can be downloaded. Yes, it is a serious thing!</p>
<h4>What Not to Do</h4>
<p>This configuration is evil and I actually found it on some tutorial but here it is, in it&#8217;s fully glory.</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">        # if the request starts with our frontcontroller, pass it on to fastcgi
        location ~ ^/index.php
        <span style="">&#123;</span>
                fastcgi_pass 127.0.0.1:<span style="">9000</span><span style="color: #666666; font-style: italic;">;</span>
                fastcgi_param SCRIPT_FILENAME /var/www/default/pub$fastcgi_script_name<span style="color: #666666; font-style: italic;">;</span>
                fastcgi_param PATH_INFO $fastcgi_script_name<span style="color: #666666; font-style: italic;">;</span>
                include /usr/local/nginx/conf/fastcgi_params<span style="color: #666666; font-style: italic;">;</span>
        <span style="">&#125;</span></pre></div></div>

<p>See how it only pushes things to index.php?  Yes, this means that no other PHP files will be parsed. WTF mate?  Yes, so please do not utilize a configuration such as this unless you know the repercussions.</p>
<h3>Non-Default Sites aka Virtual Hosts</h3>
<p>Virtual hosts are extremely easy in Nginx, all you need to define is the server name (the same goes with subdomains).  You can basically copy out the default.conf into a specific site and add in a &#8220;server_name&#8221; variable to the &#8220;sever&#8221; section followed by removing &#8220;default&#8221; from the port.  You can add in aliases by simply putting a space in between the servers. Here is an example (I also cache local files for a period of 30 days since they will likely not change):</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">server <span style="">&#123;</span>
        listen <span style="">80</span><span style="color: #666666; font-style: italic;">;</span>
        server_name digitalstruct.com www.digitalstruct.com<span style="color: #666666; font-style: italic;">;</span>
&nbsp;
        location / <span style="">&#123;</span>
                root   /var/www/digitalstruct.com/public<span style="color: #666666; font-style: italic;">;</span>
                index index.php<span style="color: #666666; font-style: italic;">;</span>
&nbsp;
        <span style="">&#125;</span>
&nbsp;
        # serve static files directly
        location ~* ^.+.<span style="">&#40;</span>jpg|jpeg|gif|css|png|js|ico|html|xml|txt<span style="">&#41;</span>$ <span style="">&#123;</span>
            access_log        off<span style="color: #666666; font-style: italic;">;</span>
            expires           30d<span style="color: #666666; font-style: italic;">;</span>
        <span style="">&#125;</span>
&nbsp;
        location ~ \.php$ <span style="">&#123;</span>
                fastcgi_pass 127.0.0.1:<span style="">9000</span><span style="color: #666666; font-style: italic;">;</span>
                fastcgi_index index.php<span style="color: #666666; font-style: italic;">;</span>
                fastcgi_param SCRIPT_FILENAME /var/www/digitalstruct.com/public$fastcgi_script_name<span style="color: #666666; font-style: italic;">;</span>
                fastcgi_param PATH_INFO $fastcgi_script_name<span style="color: #666666; font-style: italic;">;</span>
                include /usr/local/nginx/conf/fastcgi_params<span style="color: #666666; font-style: italic;">;</span>
        <span style="">&#125;</span>
<span style="">&#125;</span></pre></div></div>

<p>That&#8217;s just about all you need for now with Nginx, if you run into issues the <a href="http://wiki.nginx.org/Main">nginx wiki</a> has quite a large amount of links to get you started in the right direction with rewriting those old nasty apache rewrite rules.</p>
<h2>Conclusion</h2>
<p>While this posting was not as detailed as I was hoping it to be, I hope that you can see some of the items that I was attempting to address, specifically the PHP portion in ensuring that you are covering yourself when it comes to ensuring that people are not downloading your configuration.  Also if you are running multiple virtual hosts, it is a good idea to ensure that they are running under separate users.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.digitalstruct.com/2010/07/12/getting-started-with-nginx-and-php-fpm/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>PHP Continuous Integration with Atlassian Bamboo</title>
		<link>http://blog.digitalstruct.com/2010/03/01/php-continuous-integration-with-atlassian-bamboo/</link>
		<comments>http://blog.digitalstruct.com/2010/03/01/php-continuous-integration-with-atlassian-bamboo/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 02:46:09 +0000</pubDate>
		<dc:creator>Mike Willbanks</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.digitalstruct.com/?p=113</guid>
		<description><![CDATA[Continuous integration is all the rage these days; you are unit testing your code are you not? During some consulting in January with the help of Sebastian Bergmann, from thePHP.cc, we setup continuous integration utilizing Atlassian Bamboo and received training on PHPUnit. Using Atlassian Bamboo for continuous integration will take you a bit to setup, [...]]]></description>
			<content:encoded><![CDATA[<p>Continuous integration is all the rage these days; you are unit testing your code are you not?  During some consulting in January with the help of <a href="http://sebastian-bergmann.de">Sebastian Bergmann</a>, from <a href="http://thephp.cc/">thePHP.cc</a>, we setup continuous integration utilizing Atlassian Bamboo and received training on <a href="http://www.phpunit.de/">PHPUnit</a>.</p>
<p>Using Atlassian Bamboo for continuous integration will take you a bit to setup, however, I have found it to be an invaluable tool when utilizing the Atlassian stack (JIRA, Confluence, Crucible, Bamboo and Crowd).</p>
<h2>Overview</h2>
<p>This posting assumes the following:</p>
<ul>
<li>You have Atlassian Bamboo setup</li>
<li>Ant is available on the system</li>
<li>You already have PHPUnit setup for your project</li>
<li>You have selected a coding standard</li>
</ul>
<p>This posting will go over the following:</p>
<ul>
<li>Getting Started</li>
<li>PHP Depend</li>
<li>PHP Code Browser</li>
<li>PHP Code Sniffer</li>
<li>PHP Copy/Paste Detector</li>
<li>PHP Mess Detector</li>
<li>PHPUnit</li>
</ul>
<h2>Getting Started</h2>
<p>Welcome to the voyage of continuous integration with Bamboo, now that you are ready, lets get started.</p>
<h3>Installing the PHP Tools</h3>
<p>We will assume using the PEAR installer for installing all of the tools.</p>
<h4><a href="http://pdepend.org">PHP Depend</a></h4>
<p><code>pear channel-discover pear.pdepend.org<br />
pear install pdepend/PHP_Depend-beta</code></p>
<h4><a href="http://github.com/mayflowergmbh/PHP_CodeBrowser">PHP Code Browser</a></h4>
<p><code>pear channel-discover pear.phpunit.de<br />
pear install phpunit/PHP_CodeBrowser-alpha</code></p>
<h4><a href="http://pear.php.net/package/PHP_CodeSniffer">PHP Code Sniffer</a></h4>
<p><code>pear install PHP_CodeSniffer</code></p>
<h4><a href="http://github.com/sebastianbergmann/phpcpd">PHP Copy/Paste Detector</a></h4>
<p><code>pear install phpunit/phpcpd</code></p>
<h4><a href="http://phpmd.org/about.html">PHP Mess Detector</a></h4>
<p><code>pear channel-discover pear.phpmd.org<br />
pear install --alldeps phpmd/PHP_PMD-beta</code></p>
<h4><a href="http://www.phpunit.de">PHPUnit</a></h4>
<p><code>pear install phpunit/PHPUnit</code></p>
<h3>Build Setup in Bamboo</h3>
<h4>The Plugins</h4>
<p>There are a few plugins that we will utilize to capture build metrics.  You will want to install these to follow along:</p>
<ul>
<li><a href="https://plugins.atlassian.com/plugin/details/5825">Bamboo Checkstyle Plugin</a></li>
<li><a href="https://plugins.atlassian.com/plugin/details/5987">PMD Plugin</a></li>
</ul>
<h4>Plan Details</h4>
<p>Assuming that you are new to Bamboo and have not created a build as of yet, you will need to login to Bamboo and then click on &#8220;Create Plan&#8221; in the navigation.  Here you will find a few options, most of these are self explanatory.  Just remember that you can have several different builds so you may want to specify if it is a trunk build or a specific component build.  Once you are completed, click on next.</p>
<h4>Source Repository</h4>
<p>Put in the details to your source code repository.  If the source code repository is not available, there is likely a plug-in for it available.  Download it, restart bamboo, and continue to this step.  We do not force a clean build every time, this is due to some additional configuration that we have set for an environment in a configuration file and to reduce the amount of time to do a build.  Lastly, we do polling to detect if we need to do a build.  This helps us because we do not want a 5 minute build during every change but rather within 10 minutes of any change.  This helps reduce building too frequently or causing a potential for a race condition (assuming there was a bug in Bamboo). Go to the next step&#8230;</p>
<h4>Builder</h4>
<p>Let&#8217;s use ant for the build process.  Do not worry about this for now, we will get more into the ant build script later on.  State the build file as &#8220;build.xml&#8221; which will live in the main root of the source code (you could place this elsewhere but for simplicity sakes lets put it here and assume you&#8217;re not storing the htdocs at the root &#8211; please tell me you&#8217;re not).  Under target place &#8220;clean build&#8221; since we will do some manual cleanup of existing build information.</p>
<p>Under the following questions you will want to fill out information:</p>
<ul>
<li>Where should Bamboo look for the test result files?
<ul>
<li>Check: &#8220;The build will produce test results.&#8221;</li>
<li>Specify custom results directories: &#8220;**/build/logs/phpunit.xml&#8221;</li>
</ul>
</li>
<li>Where should Bamboo look for the PMD code analysis output?
<ul>
<li>Check: &#8220;PMD output will be produced&#8221;</li>
<li>PMD XML Directory: &#8220;**/build/logs/pmd*.xml&#8221;</li>
</ul>
</li>
<li>Would you like to view Clover Code Coverage for this plan?
<ul>
<li>Check: &#8220;Use Clover to collect Code Coverage for this build.&#8221;</li>
<li>Integration Options: Select &#8220;Clover is already integrated into this build&#8230;&#8221;</li>
<li>Clover XML Location: &#8220;**/build/logs/clover.xml&#8221;</li>
</ul>
</li>
<li>Where should Bamboo look for the CheckStyle style analysis output?
<ul>
<li>Check: &#8220;CheckStyle output will be produced&#8221;</li>
<li>CheckStyle Output Directory: &#8220;**/build/logs/checkstyle.xml&#8221;</li>
<li>We left the rest of the options blank as we have a few areas to catch up on &#8211; don&#8217;t we all?</li>
</ul>
</li>
</ul>
<p>Now go on, the hard work is just about done for setting up the build&#8230;</p>
<h4>Requirements</h4>
<p>In this screen you should see that the JDK is available and Ant is available. Go on&#8230;</p>
<h4>Artifacts</h4>
<p>We are producing several artifacts that we produce during every build, you may want to as well, therefore, lets get them all setup.  Don&#8217;t worry about what all of these are at the moment, you will have a better idea later.</p>
<table>
<thead>
<tr>
<th>Label</th>
<th>Source Directory</th>
<th>Copy Pattern</th>
</tr>
</thead>
<tbody>
<tr>
<td>Dependency Report</td>
<td>build/dependencies</td>
<td>**/*.*</td>
</tr>
<tr>
<td>CheckStyle</td>
<td>build/logs</td>
<td>**/checkstyle.xml</td>
</tr>
<tr>
<td>Code Coverage Report</td>
<td>build/coverage</td>
<td>**/*.*</td>
</tr>
<tr>
<td>PHP CPD</td>
<td>build/logs</td>
<td>**/pmd-cpd.xml</td>
</tr>
<tr>
<td>CPD Report</td>
<td>build/cpd</td>
<td>**/*.*</td>
</tr>
<tr>
<td>PHPUnit</td>
<td>build/logs</td>
<td>**/phpunit.xml</td>
</tr>
<tr>
<td>Clover</td>
<td>build/logs</td>
<td>**/clover.xml</td>
</tr>
<tr>
<td>JDepend</td>
<td>build/logs</td>
<td>**/jdepend.xml</td>
</tr>
<tr>
<td>Code Browser</td>
<td>build/codebrowser</td>
<td>**/*.*</td>
</tr>
</tbody>
</table>
<h4>Notifications</h4>
<p>Determine the types of notifications that you are looking for, I simply have myself notified on every build and a different level to ensure that the notification goes out to anyone that has been attributed to a failed build.  This is solely up to you and you can change it all later if you would like to.</p>
<h4>Post Actions</h4>
<p>We currently are not utilizing these, but I am sure that someone will find some more use for them, I am thinking of things like deploying to our testing environment, however, that&#8217;s more than a leap away at this point.</p>
<h4>Permissions</h4>
<p>Setup the permissions that you would like to have on the build plan, this is really up to you.</p>
<p>Finish up and save your build plan.  Now you will have a failing build as we need to get it up and running.</p>
<h3>Setting up Ant</h3>
<p>Since we specified the Ant builder, we need to setup our build.xml file in the directory root of the source control that we are utilizing.  In here, we want to run our tasks in parallel to expedite our processing and then run our unit testing. The following is our build.xml file, without a few excludes and such:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;project</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;My Project Name&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;build&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;clean&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;delete</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${basedir}/build&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;prepare&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mkdir</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${basedir}/build/logs&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mkdir</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${basedir}/build/codebrowser&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mkdir</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${basedir}/build/coverage&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mkdir</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${basedir}/build/cpd&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mkdir</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${basedir}/build/dependencies&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;phpcs&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${basedir}&quot;</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;phpcs&quot;</span> <span style="color: #000066;">failonerror</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000066;">output</span>=<span style="color: #ff0000;">&quot;/dev/null&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;--extensions=php --ignore=build/*,tests/* --standard=Zend --tab-width=4 --report=checkstyle --report-file=${basedir}/build/logs/checkstyle.xml .&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;phpmd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${basedir}&quot;</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;phpmd&quot;</span> <span style="color: #000066;">failonerror</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;. xml codesize --reportfile ${basedir}/build/logs/pmd.xml&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;phpcpd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${basedir}&quot;</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;phpcpd&quot;</span> <span style="color: #000066;">failonerror</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;--log-pmd=${basedir}/build/logs/pmd-cpd.xml</span>
<span style="color: #009900;">                       --exclude=build</span>
<span style="color: #009900;">                       --exclude=tests</span>
<span style="color: #009900;">                       .&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${basedir}/build/logs&quot;</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;xsltproc&quot;</span> <span style="color: #000066;">failonerror</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000066;">output</span>=<span style="color: #ff0000;">&quot;${basedir}/build/cpd/index.html&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;/path/to/cpd.xsl ${basedir}/build/logs/pmd-cpd.xml&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;pdepend&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${basedir}&quot;</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;pdepend&quot;</span> <span style="color: #000066;">failonerror</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;--jdepend-xml=${basedir}/build/logs/jdepend.xml</span>
<span style="color: #009900;">                       --jdepend-chart=${basedir}/build/dependencies/jdepend.svg</span>
<span style="color: #009900;">                       --overview-pyramid=${basedir}/build/dependencies/pyramid.svg</span>
<span style="color: #009900;">                       --optimization=best</span>
<span style="color: #009900;">                       --exclude=build,tests</span>
<span style="color: #009900;">                       .&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${basedir}/build/dependencies&quot;</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;cp&quot;</span> <span style="color: #000066;">failonerror</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;${basedir}/path/to/dependencies.html index.html&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;phpcb&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${basedir}&quot;</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;phpcb&quot;</span> <span style="color: #000066;">failonerror</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;--log ${basedir}/build/logs --source ${basedir} --output ${basedir}/build/codebrowser&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;phpunit&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${basedir}/tests&quot;</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;phpunit&quot;</span> <span style="color: #000066;">failonerror</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;--log-junit ${basedir}/build/logs/phpunit.xml</span>
<span style="color: #009900;">                       --coverage-clover ${basedir}/build/logs/clover.xml</span>
<span style="color: #009900;">                       --coverage-html ${basedir}/build/coverage&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;parallel&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parallel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;antcall</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;phpcs&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;antcall</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;phpmd&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;antcall</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;phpcpd&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;antcall</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;pdepend&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/parallel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;build&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;clean,prepare,parallel,phpunit,phpcb&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/project<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<h4>Additional Files Referenced</h4>
<p>I referenced a few files above that you will not have, mainly these files help to display some of the components that we have pushed out into our Artifacts.  I&#8217;ve linked one file and given what is in another for reference.</p>
<ul>
<li><a href="http://source.flexive.org/browse/~raw,r=461/fleXive/trunk/lib/pmd/xslt/cpdhtml.xslt">cpd.xsl</a></li>
<li>dependencies.html &#8211; a simple file that embeds the svg images.</li>
</ul>
<h2>exit(0);</h2>
<p>This should help you get up and running with Atlassian Bamboo for PHP.  We&#8217;ve been using this for the last 3+ months and it has been extremely valuable.  If you have any feedback or anything to add let me know through the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.digitalstruct.com/2010/03/01/php-continuous-integration-with-atlassian-bamboo/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>The Art of Message Queues</title>
		<link>http://blog.digitalstruct.com/2009/11/23/the-art-of-message-queues/</link>
		<comments>http://blog.digitalstruct.com/2009/11/23/the-art-of-message-queues/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 02:31:57 +0000</pubDate>
		<dc:creator>Mike Willbanks</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.digitalstruct.com/?p=111</guid>
		<description><![CDATA[At MinneBar I had done a talk on Message Queues. This talk went fairly well for being the first time I have given this besides just in talking and rambling with other folks. Thank you all for the feedback on the presentation and demos! I will incorporate this into the next time that I give [...]]]></description>
			<content:encoded><![CDATA[<p>At MinneBar I had done a talk on Message Queues.  This talk went fairly well for being the first time I have given this besides just in talking and rambling with other folks.  Thank you all for the feedback on the presentation and demos!  I will incorporate this into the next time that I give the talk.</p>
<p>As stated the slides are below, there is a little cut off and I am not sure if MinneBar did record the video in that session so you will have to see when they release the information.  Below are the slides of this presentation.</p>
<object width="500" height="410"><param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=art-of-message-queues-091123105634-phpapp02"/><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=art-of-message-queues-091123105634-phpapp02"  type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="500" height="410"></embed></object>
]]></content:encoded>
			<wfw:commentRss>http://blog.digitalstruct.com/2009/11/23/the-art-of-message-queues/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
