<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>Derick Rethans</title>
    <link>http://derickrethans.nl/archive.html</link>
    <description>This feed shows the latest 15 items</description>
    <language>en-us</language>
    <copyright>All rights reserved - Derick Rethans</copyright>
    <managingEditor>derick@derickrethans.nl (Derick Rethans)</managingEditor>
    <pubDate>Tue, 09 Feb 2010 11:39:06 +0000</pubDate>
    <lastBuildDate>Tue, 09 Feb 2010 11:39:06 +0000</lastBuildDate>
    <generator>eZ Components Feed dev (http://ezcomponents.org/docs/tutorials/Feed)</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>60</ttl>
    <item>
      <title>Xdebug 2.1.0beta2 released</title>
      <link>http://derickrethans.nl/xdebug-210beta2.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="xdebug_2_1_0beta2_released"/&gt;Xdebug 2.1.0beta2 released&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; Dieren, the Netherlands&lt;/div&gt;
        &lt;div class="date"&gt;Wednesday, February 3rd 2010, 18:51 GMT&lt;/div&gt;
      &lt;/div&gt;
      &lt;p&gt;I've just released Xdebug 2.1.0beta2 which features a few small bug fixes only. With this release the Windows 5.3/VC6 binaries also return.&lt;/p&gt;
      &lt;p&gt;One of the bug fixes is in a new feature that allows you to configure that the debugger should connect back to the IDE running on the machine that initiated the HTTP request. This feature, that originally was contributed by Lucas Nealan and Brian Shire of Facebook, allows more easy use of multiple IDEs (users) working on the same code base. In order to enable this, set &lt;a href="http://xdebug.org/docs/all_settings#remote_connect_back"&gt;xdebug.remote_connect_back&lt;/a&gt; to 1. See the documentation for more information.&lt;/p&gt;
      &lt;p&gt;Of course, this feature should only be enabled if &lt;em&gt;nobody&lt;/em&gt; besides authorized developers can access the machine on which the xdebug.remote_connect_back callback feature has been enabled. Instead of enabling this setting, you can also support multiple developers through the proxy functionality that the DBGp protocol supports. For more information on that, see &lt;a href="http://derickrethans.nl/debugging-with-multiple-users.html"&gt;Debugging with multiple users&lt;/a&gt;.&lt;/p&gt;
      &lt;p&gt;You can find the full changelog &lt;a href="http://xdebug.org/updates.php#x_2_1_0beta1"&gt;here&lt;/a&gt; and get the latest version from the &lt;a href="http://xdebug.org/download.php"&gt;download page&lt;/a&gt;.&lt;/p&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>201002031832</guid>
      <pubDate>Wed, 03 Feb 2010 18:51:00 +0000</pubDate>
    </item>
    <item>
      <title>Speaking at conferences in spring 2010</title>
      <link>http://derickrethans.nl/speaking-at-conferences-in-spring-2010.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="speaking_at_conferences_in_spring_2010"/&gt;Speaking at conferences in spring 2010&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; London, UK&lt;/div&gt;
        &lt;div class="date"&gt;Tuesday, January 26th 2010, 14:22 GMT&lt;/div&gt;
      &lt;/div&gt;
      &lt;p&gt;In the next few months, I will be speaking at the following conferences:&lt;/p&gt;
      &lt;p&gt;&lt;a href="http://conference.phpbenelux.eu/"&gt;PHPBenelux Conference&lt;/a&gt; 2010 is the first annual conference by the PHPBenelux usergroup. It is organized in Antwerp on Saturday January 30th. I will be giving a keynote titled "The PHP Universe".&lt;/p&gt;
      &lt;p&gt;&lt;a href="http://phpconference.co.uk/"&gt;PHP UK Conference&lt;/a&gt; is &lt;a href="http://www.phplondon.org/wiki/Main_Page"&gt;PHP London's&lt;/a&gt; fifth annual conference and held on Friday February 26th at the &lt;a href="http://www.businessdesigncentre.co.uk/"&gt;Business Design Centre&lt;/a&gt;. I will be talking on PHP on the D-BUS.&lt;/p&gt;
      &lt;p&gt;&lt;a href="http://confoo.ca/en"&gt;ConFoo&lt;/a&gt; (formerly PHP Québec) is the first edition of the Confoo.ca Conference. From March 10th to 12th 2010, international experts in Java, .Net, PHP, Python and Ruby will present solutions for developers and project managers the Hilton Bonaventure Hotel, located in downtown Montréal. I will be talking on &lt;a href="http://confoo.ca/en/2010/session/advanced-date-time-handling-with-php"&gt;Advanced Date/Time handling with PHP&lt;/a&gt;.&lt;/p&gt;
      &lt;p&gt;Hope to see you there!&lt;/p&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>201001261422</guid>
      <pubDate>Tue, 26 Jan 2010 14:22:00 +0000</pubDate>
    </item>
    <item>
      <title>Obtaining the next month in PHP</title>
      <link>http://derickrethans.nl/obtaining-the-next-month-in-php.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="obtaining_the_next_month_in_php"/&gt;Obtaining the next month in PHP&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; London, UK&lt;/div&gt;
        &lt;div class="date"&gt;Friday, January 8th 2010, 09:13 GMT&lt;/div&gt;
      &lt;/div&gt;
      &lt;p&gt;Over and over again PHP users complain that &lt;code&gt;next month&lt;/code&gt; in PHP's date-string parser doesn't go to the next month, but instead skips to the one after next month; like in the following example:&lt;/p&gt;
      &lt;pre&gt;&lt;?php
$d = new DateTime( '2010-01-31' );
$d-&gt;modify( 'next month' );
echo $d-&gt;format( 'F' ), "\n";
?&gt;

&lt;/pre&gt;
      &lt;p&gt;The output of the little script will be &lt;code&gt;March&lt;/code&gt;. March obviously doesn't follow January as February is in between. However, the current behavior &lt;strong&gt;is&lt;/strong&gt; correct. The following happens internally:&lt;/p&gt;
      &lt;ul&gt;
        &lt;li&gt;
          &lt;p&gt;&lt;code&gt;next month&lt;/code&gt; increases the month number (originally 1) by one. This makes the date &lt;code&gt;2010-02-31&lt;/code&gt;.&lt;/p&gt;
        &lt;/li&gt;
        &lt;li&gt;
          &lt;p&gt;The second month (February) only has 28 days in 2010, so PHP auto-corrects this by just continuing to count days from February 1st. You then end up at March 3rd.&lt;/p&gt;
        &lt;/li&gt;
        &lt;li&gt;
          &lt;p&gt;The formatting strips off the year and day, resulting in the output &lt;code&gt;March&lt;/code&gt;.&lt;/p&gt;
        &lt;/li&gt;
      &lt;/ul&gt;
      &lt;p&gt;This can easily be seen when echoing the date with a full date format, which will output &lt;code&gt;March 3rd, 2010&lt;/code&gt;:&lt;/p&gt;
      &lt;pre&gt;&lt;?php
echo $d-&gt;format( 'F jS, Y' ), "\n";
?&gt;

&lt;/pre&gt;
      &lt;p&gt;To obtain the correct behavior, you can use some of PHP 5.3's new functionality that introduces the relative time stanza &lt;code&gt;first day of&lt;/code&gt;. This stanza can be used in combination with &lt;code&gt;next month&lt;/code&gt;, &lt;code&gt;fifth month&lt;/code&gt; or &lt;code&gt;+8 months&lt;/code&gt; to go to the &lt;strong&gt;first day&lt;/strong&gt; of the specified month. Instead of &lt;code&gt;next month&lt;/code&gt; from the previous example, we use &lt;code&gt;first day of next month&lt;/code&gt; here:&lt;/p&gt;
      &lt;pre&gt;&lt;?php
$d = new DateTime( '2010-01-08' );
$d-&gt;modify( 'first day of next month' );
echo $d-&gt;format( 'F' ), "\n";
?&gt;

&lt;/pre&gt;
      &lt;p&gt;This script will correctly output &lt;code&gt;February&lt;/code&gt;. The following things happen when PHP processes this &lt;code&gt;first day of next month&lt;/code&gt; stanza:&lt;/p&gt;
      &lt;ul&gt;
        &lt;li&gt;
          &lt;p&gt;&lt;code&gt;next month&lt;/code&gt; increases the month number (originally 1) by one. This makes the date &lt;code&gt;2010-02-31&lt;/code&gt;.&lt;/p&gt;
        &lt;/li&gt;
        &lt;li&gt;
          &lt;p&gt;&lt;code&gt;first day of&lt;/code&gt; sets the day number to 1, resulting in the date &lt;code&gt;2010-02-01&lt;/code&gt;.&lt;/p&gt;
        &lt;/li&gt;
        &lt;li&gt;
          &lt;p&gt;The formatting strips off the year and day, resulting in the output &lt;code&gt;February&lt;/code&gt;.&lt;/p&gt;
        &lt;/li&gt;
      &lt;/ul&gt;
      &lt;p&gt;Besides &lt;code&gt;first day of&lt;/code&gt;, there is an equivalent &lt;code&gt;last day of&lt;/code&gt; to go to the last day of a month. The following example demonstrates this:&lt;/p&gt;
      &lt;pre&gt;&lt;?php
$d = new DateTime( '2010-01-08' );
$d-&gt;modify( 'last day of next month' );
echo $d-&gt;format( 'F jS, Y' ), "\n";
?&gt;

&lt;/pre&gt;
      &lt;p&gt;This outputs &lt;code&gt;February 28th, 2010&lt;/code&gt;. Internally the following happens:&lt;/p&gt;
      &lt;img src="/images/content/datebook-cover.jpg" class="right" alt="datebook-cover.jpg"/&gt;
      &lt;ul&gt;
        &lt;li&gt;
          &lt;p&gt;&lt;code&gt;next month&lt;/code&gt; increases the month number (originally 1) by one. This makes the date &lt;code&gt;2010-02-08&lt;/code&gt;.&lt;/p&gt;
        &lt;/li&gt;
        &lt;li&gt;
          &lt;p&gt;&lt;code&gt;last day of&lt;/code&gt; increases the month number by one, and sets the day number to 0, resulting in the date &lt;code&gt;2010-03-00&lt;/code&gt;.&lt;/p&gt;
        &lt;/li&gt;
        &lt;li&gt;
          &lt;p&gt;PHP then auto-corrects the invalid day number 0 by removing one from the month and skipping to the last day of that month, resulting in &lt;code&gt;2010-02-28&lt;/code&gt;.&lt;/p&gt;
        &lt;/li&gt;
      &lt;/ul&gt;
      &lt;p&gt;I hope this clears up some of the behaviour of PHP's Date/Time handling. For more information on Date/Time Programming with PHP, please refer to my book "&lt;a href="http://tinyurl.com/phpdatebookuk"&gt;php|architect's Guide to Date and Time Programming&lt;/a&gt;" that is available through &lt;a href="http://tinyurl.com/phpdatebookuk"&gt;Amazon&lt;/a&gt;.&lt;/p&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>201001080913</guid>
      <pubDate>Fri, 08 Jan 2010 09:13:00 +0000</pubDate>
    </item>
    <item>
      <title>Xdebug 2.1.0beta1 released</title>
      <link>http://derickrethans.nl/xdebug-210beta1.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="xdebug_2_1_0beta1_released"/&gt;Xdebug 2.1.0beta1 released&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; London, UK&lt;/div&gt;
        &lt;div class="date"&gt;Sunday, January 3rd 2010, 02:08 GMT&lt;/div&gt;
      &lt;/div&gt;
      &lt;p&gt;It has been two years since I &lt;a href="http://derickrethans.nl/xdebug-2-released.html"&gt;released&lt;/a&gt; &lt;a href="http://xdebug.org"&gt;Xdebug&lt;/a&gt; 2.0.0. Since then  I've added many new features to Xdebug. For some of those new features you can find a little description below—I will write more about these, and other features later.&lt;/p&gt;
      &lt;p&gt;Besides the features, I also fixed a whole array of bugs and Xdebug 2.1.0 comes with PHP 5.3 support. From now on I will not be supporting any PHP versions less than PHP 5.1 anymore. But now on to the descriptions:&lt;/p&gt;
      &lt;p&gt;
        &lt;strong&gt;Header Setting Interception&lt;/strong&gt;
      &lt;/p&gt;
      &lt;p&gt;All functions that set HTTP headers such as with &lt;a href="http://php.net/header"&gt;header()&lt;/a&gt; and &lt;a href="http://php.net/setcookie"&gt;setcookie()&lt;/a&gt; are now intercepted by Xdebug. The intercepted headers are stored internally in an array that can be retrieved by calling the &lt;a href="http://xdebug.org/docs/all_functions#xdebug_get_headers"&gt;xdebug_get_headers()&lt;/a&gt; function. This is very useful in cases where you need to test certain functionality that sets headers somewhere deep in code. This function is also used in &lt;a href="http://ezcomponents.org"&gt;eZ Components'&lt;/a&gt; test suite to &lt;a href="http://svn.ez.no/svn/ezcomponents/trunk/MvcTools/tests/response_writers/http.php"&gt;test&lt;/a&gt; whether the correct HTTP headers are set in the &lt;a href="http://ezcomponents.org/s/MvcTools"&gt;MvcTools&lt;/a&gt; component.&lt;/p&gt;
      &lt;p&gt;
        &lt;strong&gt;Variable Assignment Tracing&lt;/strong&gt;
      &lt;/p&gt;
      &lt;p&gt;Allows you to record changes to variables in scripts to &lt;a href="http://xdebug.org/docs/execution_trace"&gt;trace files&lt;/a&gt;. I've already written more about it in &lt;a href="http://derickrethans.nl/variable-tracing-with-xdebug.html"&gt;Variable tracing with Xdebug&lt;/a&gt;.&lt;/p&gt;
      &lt;p&gt;
        &lt;strong&gt;"Scream" Support&lt;/strong&gt;
      &lt;/p&gt;
      &lt;p&gt;The &lt;a href="http://pecl.php.net/scream"&gt;scream&lt;/a&gt; PECL extension disables the @ (shut-up) operator to actually see all notices, warnings and errors that PHP generates. The scream extension's functionality have been duplicated as Xdebug's xdebug.scream php.ini setting. Why disabling the @-operator is a good thing, I've already outlined in &lt;a href="http://derickrethans.nl/five-reasons-why-the-shutop-operator-should-be-avoided.html"&gt;Five reasons why the shut-op operator (@) should be avoided&lt;/a&gt;.&lt;/p&gt;
      &lt;p&gt;
        &lt;strong&gt;What's Next?&lt;/strong&gt;
      &lt;/p&gt;
      &lt;p&gt;There are still a few bugs left that need some attention, but this first beta should have most of them fixed. Please test the beta as much as you can and provide feedback in the &lt;a href="http://bugs.xdebug.org"&gt;issue tracker&lt;/a&gt;. After this initial beta it is like that one more more betas will follow before I prepare a release candidate. Xdebug 2.1.0beta1 can be obtained through the &lt;a href="http://xdebug.org/download.php"&gt;Xdebug website&lt;/a&gt; and a full changelog is also &lt;a href="http://xdebug.org/updates.php#x_2_1_0beta1"&gt;available&lt;/a&gt;. You can also &lt;a href="http://twitter.com/xdebug"&gt;follow Xdebug on twitter&lt;/a&gt; to be kept up-to-date with the latest developments.&lt;/p&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>201001030112</guid>
      <pubDate>Sun, 03 Jan 2010 02:08:00 +0000</pubDate>
    </item>
    <item>
      <title>PHP Development Environment 2.0</title>
      <link>http://derickrethans.nl/multiple-php-versions.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="php_development_environment_2_0"/&gt;PHP Development Environment 2.0&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; London, UK&lt;/div&gt;
        &lt;div class="date"&gt;Thursday, December 31st 2009, 02:26 UTC&lt;/div&gt;
      &lt;/div&gt;
      &lt;p&gt;When &lt;a href="http://derickrethans.nl/xdebug-moved-to-a-new-server.html"&gt;moving&lt;/a&gt; the &lt;a href="http://xdebug.org"&gt;Xdebug&lt;/a&gt; website and my own website to a new server I had to pick a web server to serve the pages through PHP. Up to then I was still using Apache 1.3 with zero intentions to ever upgrade to any later version. I'd heard a lot about &lt;a href="http://www.lighttpd.net/"&gt;lighttpd&lt;/a&gt; and decided to give that a try—yes, that meant something that I didn't really know to well was going to run in a production environment. Unlike Apache, with lighttpd PHP doesn't run as a module, but instead you run it out of process with something called FastCGI.&lt;/p&gt;
      &lt;p&gt;On my development machine I was also running Apache 1.3 with PHP as static module embedded. If I want to test something with a different PHP version, I would start a different Apache daemon. When I had a quick look the other day, I found that I had about 28 different binaries named &lt;code&gt;httpd-{Apache
version}-{PHP version}&lt;/code&gt; ranging from PHP 4.1.2 to 6.0dev. Some of those I hadn't used for years.&lt;/p&gt;
      &lt;p&gt;All my PHP installations were installed with the same prefix (&lt;code&gt;/usr/local&lt;/code&gt;), where the last built PHP version was available as &lt;code&gt;php&lt;/code&gt; and additional versions as &lt;code&gt;php-{version}&lt;/code&gt;. An annoyance with this is, is that I had to run &lt;code&gt;make install&lt;/code&gt; in one of the PHP source directories before I could compile extensions against a different PHP version than the &lt;em&gt;latest installed one&lt;/em&gt;. This combined with the enormous amount of httpds and the inability to run multiple versions of PHP at the same time prompted me to come up with something better: &lt;em&gt;PHP Development Environment 2.0&lt;/em&gt;.&lt;/p&gt;
      &lt;p&gt;
        &lt;strong&gt;Multiple PHP Installations&lt;/strong&gt;
      &lt;/p&gt;
      &lt;p&gt;The first thing I wanted to do was to make sure that each minor PHP version (5.1.x, 5.2.x, 5.3.x and 6.0.x) could be installed alongside each other, and that I could compile extensions to all of them without having to re-run &lt;code&gt;make
install&lt;/code&gt;. I did this by specifying &lt;code&gt;--prefix=/usr/local/php/{PHP
version}&lt;/code&gt; to the PHP configure call. At the same time, I also removed the &lt;code&gt;--with-apache&lt;/code&gt; configure option and for PHP 5.1 and PHP 5.2 I added the &lt;code&gt;--enable-fastcgi&lt;/code&gt; option which is default enabled for PHP 5.3 and PHP 6.0. The initial section of the configure invocation now looks like for the PHP 5.2 build:&lt;/p&gt;
      &lt;pre&gt;./configure --prefix=/usr/local/php/5.2dev --enable-fastcgi \
  --with-gd  ...more configure options here...

&lt;/pre&gt;
      &lt;p&gt;Although &lt;code&gt;/usr/local/bin&lt;/code&gt; is usually in the path, but &lt;code&gt;/usr/local/php/5.2dev/bin&lt;/code&gt; is definitely not. The initial goal was to be able to easily switch between different PHP versions, so I added a snippet to my &lt;code&gt;.bashrc&lt;/code&gt; that sets the correct &lt;code&gt;PATH&lt;/code&gt; environment variable depending on the selected PHP version:&lt;/p&gt;
      &lt;pre&gt;function pe () {
  version=$1
  shift

  if [ "$#" == "0" ]; then
    export PATH=/usr/local/php/${version}/bin:/usr/local/bin:/usr/bin:/bin
  else
    PATH=/usr/local/php/${version}/bin:$PATH $@
  fi
}

&lt;/pre&gt;
      &lt;p&gt;This bash function is then evoked like &lt;code&gt;pe 5.3dev&lt;/code&gt; to set the path in such a way that &lt;code&gt;php&lt;/code&gt; runs the PHP 5.3 binary, as well as additional tools such as &lt;code&gt;pear&lt;/code&gt;, &lt;code&gt;phpize&lt;/code&gt; (required to build extensions) and &lt;code&gt;php-config&lt;/code&gt;. If you forget to call the &lt;code&gt;pe&lt;/code&gt; function, then when running &lt;code&gt;php&lt;/code&gt; you will encounter the warning &lt;code&gt;bash: php: command not found&lt;/code&gt;. You could pick a default version if you wanted, but I prefer that I always have to be explicit about which PHP version I pick. Multiple install paths makes it easier to maintain multiple PHP installs, but it also means that you have to install tools such as &lt;a href="http://www.phpunit.de/"&gt;PHP Unit&lt;/a&gt; for each of the installations.&lt;/p&gt;
      &lt;p&gt;
        &lt;strong&gt;Setting up Lighttpd&lt;/strong&gt;
      &lt;/p&gt;
      &lt;p&gt;Now that I had multiple PHP installations, I could move on to setting up lighttpd. As I have mentioned, I never used lighttpd before and decided to take the easy way by installing it with &lt;code&gt;apt-get install lighttpd&lt;/code&gt;. PHP works through the FastCGI interface with lighttpd which you can enable with &lt;code&gt;lighttpd-enable-mod cgi fastcgi simple-vhost&lt;/code&gt; (I also enabled CGI and simple VHOSTing).&lt;/p&gt;
      &lt;p&gt;To enable PHP as FastCGI server, and to be able to run multiple versions at the same time, I modified the &lt;code&gt;/etc/lighttpd/conf-enabled/10-fastcgi.conf&lt;/code&gt; configuration file. Find my annotated version below:&lt;/p&gt;
      &lt;pre&gt;## Enable the FastCGI module.
server.modules   += ( "mod_fastcgi" )

&lt;/pre&gt;
      &lt;p&gt;Next we start an FastCGI server for the default PHP version (5.3) on the default port (80) by enabling it in the global scope:&lt;/p&gt;
      &lt;pre&gt;fastcgi.server    = ( ".php" =&gt;
  ((
    ## The path to the PHP-CGI executable
    "bin-path" =&gt; "/usr/local/php/5.3dev/bin/php-cgi",

    ## The listening socket that allows lighttpd to talk
    ## to the PHP FastCGI process. This needs to be
    ## different for each fastcgi.server definition.
    "socket" =&gt; "/tmp/php80.socket",

    ## Configure the number of parent processes that are
    ## spawned by lighttpd (max-procs) and configure how
    ## many many workers should be started (4) and the
    ## maximum number of requests that they can process
    ## before they get recycled (10000).
    "max-procs" =&gt; 1,
    "bin-environment" =&gt; (
      "PHP_FCGI_CHILDREN" =&gt; "4",
      "PHP_FCGI_MAX_REQUESTS" =&gt; "10000"
    ),

    ## configure additional bits
    "bin-copy-environment" =&gt; (
      "PATH", "SHELL", "USER"
    ),
    "broken-scriptfilename" =&gt; "enable"
    "idle-timeout" =&gt; 20,
  ))
)

&lt;/pre&gt;
      &lt;p&gt;Now tell lighttpd to also listen on port 8502. And in case requests come in over this port, use the defined FastCGI server for *.php. In this case we configure PHP 5.2. Similarily you can also define a block for PHP 5.1 (on a suggested port 8501) and PHP 6.0:&lt;/p&gt;
      &lt;pre&gt;$SERVER["socket"] == ":8502" {
  fastcgi.server    = ( ".php" =&gt;
    ((
      "bin-path" =&gt; "/usr/local/php/5.2dev/bin/php-cgi",
      "socket" =&gt; "/tmp/php8052.socket",
      "max-procs" =&gt; 1,
      "idle-timeout" =&gt; 20,
      "bin-environment" =&gt; (
        "PHP_FCGI_CHILDREN" =&gt; "4",
        "PHP_FCGI_MAX_REQUESTS" =&gt; "10000"
      ),
      "bin-copy-environment" =&gt; (
        "PATH", "SHELL", "USER"
      ),
      "broken-scriptfilename" =&gt; "enable"
    ))
  )
}

&lt;/pre&gt;
      &lt;p&gt;Tell lighttpd to also listen on port 8502. Because we're not overriding the fastcgi.server configuration from the global configuration (the bit were we set-up PHP 5.3 in the first few lines of the file), it will reuse this fastcgi.server configuration enabling requests for .php files coming in on port 80 or 8503 to be processed by the globally configured FastCGI server:&lt;/p&gt;
      &lt;pre&gt;$SERVER["socket"] == ":8503" {
# Just some dummy text because lighttpd doesn't allow
# empty definitions.
}

&lt;/pre&gt;
      &lt;p&gt;With the configuration made, you only have to restart lighttpd with &lt;code&gt;/etc/init.d/lighttpd force-reload&lt;/code&gt; and PHP is ready to go on multiple ports with different PHP versions.&lt;/p&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>200912301652</guid>
      <pubDate>Thu, 31 Dec 2009 02:26:00 +0000</pubDate>
    </item>
    <item>
      <title>New website layout</title>
      <link>http://derickrethans.nl/new-layout.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="new_website_layout"/&gt;New website layout&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; London, UK&lt;/div&gt;
        &lt;div class="date"&gt;Saturday, December 26th 2009, 15:13 UTC&lt;/div&gt;
      &lt;/div&gt;
      &lt;p&gt;Just like Xdebug's server was moved&lt;a href="#_footnote_0_1" class="footnote"&gt;1&lt;/a&gt; to a new VPS at &lt;a href="http://www.xtrahost.co.uk/"&gt;XtraHosting&lt;/a&gt; so did my personal website (the one you're looking at). Hosting it on my own gives me full control over what software runs it, and which PHP version and extensions I run. I switched most of the code from a PHP 4.1 atrocity to PHP 5.3 goodness.&lt;/p&gt;
      &lt;p&gt;At the same time, I also moved all the contents from some self-invented XML format to &lt;a href="http://docutils.sourceforge.net/rst.html"&gt;reStructuredText&lt;/a&gt;. reStructuredText is a format that can be parsed and transformed into other formats by &lt;a href="http://ezcomponents.org/"&gt;eZ Components&lt;/a&gt;' &lt;a href="http://ezcomponents.org/s/Document"&gt;Document&lt;/a&gt; component. Right now I am transforming to HTML only, but in the future I will also transform certain articles to PDFs. Comments can also make use of some of the reStructuredText formatting options, but there are still some things that need sorting out there.&lt;/p&gt;
      &lt;p&gt;Besides changing the layout and converting the content to a more manageable format, I also introduced a stream of &lt;a href="http://dopplr.com"&gt;dopplr&lt;/a&gt;, &lt;a href="http://flickr.com"&gt;flickr&lt;/a&gt; and &lt;a href="http://twitter.com"&gt;twitter&lt;/a&gt; updates on the right side. This is implemented by parsing the relative RSS feeds from the different sources. If location information is present, this is also shown in this feed. Previously I would only export an RSS feed for all of the content, but with this site update, there is now a feed for every tag that I've used. All RSS functionality is provided by the &lt;a href="http://ezcomponents.org/s/Feed"&gt;Feed&lt;/a&gt; component of &lt;a href="http://ezcomponents.org/"&gt;eZ Components&lt;/a&gt; (although a patch is currently needed for the location information).&lt;/p&gt;
      &lt;p&gt;I'm not a 100% happy with the new layout, so most likely I will be doing some changes in the near future.&lt;/p&gt;
      
    &lt;/div&gt;
    &lt;ul class="footnotes"&gt;
      &lt;li&gt;
        &lt;a name="_footnote_0_1"&gt;1&lt;/a&gt;
        &lt;p&gt;&lt;a href="http://derickrethans.nl/xdebug-moved-to-a-new-server.html"&gt;http://derickrethans.nl/xdebug-moved-to-a-new-server.html&lt;/a&gt;&lt;/p&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>200912261513</guid>
      <pubDate>Sat, 26 Dec 2009 15:13:00 +0000</pubDate>
    </item>
    <item>
      <title>Xdebug moved to a new server</title>
      <link>http://derickrethans.nl/xdebug-moved-to-a-new-server.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="xdebug_moved_to_a_new_server"/&gt;Xdebug moved to a new server&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; London, UK&lt;/div&gt;
        &lt;div class="date"&gt;Friday, November 27th 2009, 14:42 GMT&lt;/div&gt;
      &lt;/div&gt;
      &lt;p&gt;&lt;a href="http://xdebug.org"&gt;Xdebug&lt;/a&gt; 's CVS server was previously hosted at &lt;a href="http://ez.no"&gt;eZ Systems&lt;/a&gt;' office, but as I am leaving soon I needed to move this to a different server. At the same time, I decided to also convert from CVS to SVN. So from now on, there is no more cvs.xdebug.org, but just a &lt;a href="http://svn.xdebug.org"&gt;svn.xdebug.org&lt;/a&gt;. This SVN server doesn't only host Xdebug, but also some of my other projects, such as &lt;a href="http://svn.xdebug.org/cgi-bin/viewvc.cgi/vld/?root%3Dphp"&gt;VLD&lt;/a&gt; (opcode dumper to aid PHP engine development), the &lt;a href="http://svn.xdebug.org/cgi-bin/viewvc.cgi/?root%3Dxdebug"&gt;DBGp&lt;/a&gt; specs (debugger protocol as used by Xdebug and &lt;a href="http://aspn.activestate.com/ASPN/Downloads/Komodo/RemoteDebugging"&gt;ActiveState's debuggers&lt;/a&gt;) and my OpenMoko &lt;a href="http://svn.xdebug.org/cgi-bin/viewvc.cgi/?root%3Dopenmoko"&gt;perversions and projects&lt;/a&gt;.&lt;/p&gt;
      &lt;p&gt;Xdebug can now be checked out from SVN with:&lt;/p&gt;
      &lt;pre&gt;svn co svn://svn.xdebug.org/svn/xdebug/xdebug/trunk xdebug

&lt;/pre&gt;
      &lt;p&gt;All other Xdebug services (&lt;a href="http://xdebug.org/support.php#list"&gt;mailinglists&lt;/a&gt;, web, e-mail and the &lt;a href="http://bugs.xdebug.org"&gt;bug system&lt;/a&gt;) moved to the same server as well. Just be aware that DNS servers might still need updating when you try to access the new services.&lt;/p&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>200911271442</guid>
      <pubDate>Fri, 27 Nov 2009 14:42:00 +0000</pubDate>
    </item>
    <item>
      <title>Xdebug and tracing memory usage</title>
      <link>http://derickrethans.nl/xdebug-and-tracing-memory-usage.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="xdebug_and_tracing_memory_usage"/&gt;Xdebug and tracing memory usage&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; London, UK&lt;/div&gt;
        &lt;div class="date"&gt;Friday, November 13th 2009, 11:59 GMT&lt;/div&gt;
      &lt;/div&gt;
      &lt;p&gt;Recently people started to ask me how to use &lt;a href="http://xdebug.org"&gt;Xdebug&lt;/a&gt; to figure out which parts of applications use a lot of memory. Traditionally this was part of Xdebug's &lt;a href="http://xdebug.org/docs/profiler"&gt;profiling&lt;/a&gt; functionality. Unfortunately the cachegrind format didn't fit this so well, and because it returned incorrect data I removed this functionality from the profiler. However, there is other functionality in Xdebug that does provide the correct data: the &lt;a href="http://xdebug.org/docs/execution_trace"&gt;function traces&lt;/a&gt;.&lt;/p&gt;
      &lt;p&gt;Function traces log every include, function call and method call to a file. If the &lt;a href="http://xdebug.org/docs/execution_trace#trace_format"&gt;xdebug.trace_format&lt;/a&gt; setting is set to "1" then the trace file is an easy-to-parse tab separated format. The information that is logged includes the time-index when the function started and ended, and it also contains the amount of memory that was in use when entering the function, as well as when leaving it. With the last two numbers it's rather trivial to write a script to figure out which functions/methods increase the memory usage a lot. Of course, nobody had written a script yet to do anything with this information&lt;/p&gt;
      &lt;p&gt;As part of my preparations for my Xdebug talk at &lt;a href="http://phpconference.com"&gt;IPC&lt;/a&gt; next week, I now have written such a script. The script parses the tab-separated function trace files and aggregates all the information by function name. You can sort the output on a few different keys: time-own, memory-own, time-inclusive, memory-inclusive and calls. You can also configure how many elements it will show. As an example here is some output from a trace of one of the presentation system's PHP scripts:&lt;/p&gt;
      &lt;pre&gt;$ php tracefile-analyser.php trace.2043925204.xt memory-own 20

&lt;/pre&gt;
      &lt;pre&gt;parsing...
Done.
Showing the 20 most costly calls sorted by 'memory-own'.
                                               Inclusive        Own
function                               #calls  time     memory  time     memory
-------------------------------------------------------------------------------
require_once                                9  0.0541  4595160  0.0277  2548104
{main}                                      1  0.0600  2906032  0.0034   249744
fread                                       4  0.0001    33296  0.0001    33296
session_start                               1  0.0002    31824  0.0002    31824
XML_Presentation-&gt;startHandler             38  0.0073    36360  0.0035    18424
_pres_slide-&gt;_pres_slide                   27  0.0009    10152  0.0009    10152
_presentation-&gt;_presentation                1  0.0001     7912  0.0001     7912
strtolower                                 67  0.0017     6456  0.0017     6456
compact                                     1  0.0000     4832  0.0000     4832
each                                        5  0.0001     4320  0.0001     4320
XML_Presentation-&gt;endHandler               38  0.0014     3800  0.0014     3960
_slide-&gt;_slide                              1  0.0001     3896  0.0001     3896
XML_Slide-&gt;startHandler                     4  0.0009    10800  0.0004     3736
_image-&gt;_image                              1  0.0000     3040  0.0000     3040
fopen                                       2  0.0001     2816  0.0001     2816
getimagesize                                1  0.0001     2296  0.0001     2296
display-&gt;display                            1  0.0001     2120  0.0001     2120
explode                                     2  0.0001     2120  0.0001     2120
xml_parser_create                           2  0.0001     1680  0.0001     1680
XML_Parser-&gt;_initHandlers                   2  0.0011     1600  0.0005     1360

&lt;/pre&gt;
      &lt;p&gt;The script is available from SVN by running:&lt;/p&gt;
      &lt;pre&gt;svn co svn://svn.xdebug.org:/svn/xdebug/xdebug/trunk/contrib xdebug/contrib

&lt;/pre&gt;
      &lt;p&gt;The script to run is then "tracefile-analyser.php" from inside the "xdebug/contrib" directory.&lt;/p&gt;
      &lt;p&gt;&lt;strong&gt;Update 2009-12-28&lt;/strong&gt;: Changed the CVS instructions to the new SVN instructions.&lt;/p&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>200911131159</guid>
      <pubDate>Fri, 13 Nov 2009 11:59:00 +0000</pubDate>
    </item>
    <item>
      <title>Unix Epoch and PHP's calendar system</title>
      <link>http://derickrethans.nl/unix-epoch-and-phps-calendar-system.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="unix_epoch_and_php_s_calendar_system"/&gt;Unix Epoch and PHP's calendar system&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; London, UK&lt;/div&gt;
        &lt;div class="date"&gt;Thursday, November 12th 2009, 12:32 GMT&lt;/div&gt;
      &lt;/div&gt;
      &lt;p&gt;I just saw a &lt;a href="http://news.php.net/php.doc.cvs/5325"&gt;commit&lt;/a&gt; flying past as a response to &lt;a href="http://bugs.php.net/bug.php?edit%3D1&amp;amp;id%3D50155"&gt;PHP bug #50155&lt;/a&gt;. While &lt;em&gt;right&lt;/em&gt; now it is proper to define the Unix Epoch at "1970-01-01 00:00:00 UTC", UTC wasn't actually defined until 1972. So it would be more correct to define the Unix Epoch as "the number of seconds elapsed since midnight &lt;a href="http://dictionary.reference.com/browse/proleptic"&gt;proleptic&lt;/a&gt; Coordinated Universal Time (UTC) of January 1, 1970, not counting leap seconds." (from Wikipedia). What the bit "not counting leap seconds" means, I've already explained before in &lt;a href="/leap_seconds_and_what_to_do_with_them.php"&gt;Leap Seconds and What To Do With Them&lt;/a&gt;.&lt;/p&gt;
      &lt;p&gt;Similarly, PHP's internal calendar is the &lt;a href="http://en.wikipedia.org/wiki/ISO_8601#Years"&gt;ISO 8601 calendar&lt;/a&gt;. This is a modification of the proleptic &lt;a href="http://en.wikipedia.org/wiki/Gregorian_calendar"&gt;Gregorian&lt;/a&gt; calendar. The Gregorian calendar implements the current set of leap years every 4 years, but not every 100 years, but again every 400 years (to get to an average year length of 365.2425 days). Obviously this calendar is only in use since 1582 (some countries adopted it as late as the 1900s), so using days like 1066-10-14 in the Gregorian calendar makes little sense because that calendar didn't exist back then. Now, PHP's ISO 8601-based calendar even modifies the Gregorian calendar by including the year 0. The Gregorian calendar goes straight from -1 to 1 which is a pain to do proper date calculations with. Therefore the ISO 8601 calendar uses &lt;a href="http://en.wikipedia.org/wiki/Astronomical_year_numbering"&gt;Astronomical year numbering&lt;/a&gt;.&lt;/p&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>200911121232</guid>
      <pubDate>Thu, 12 Nov 2009 12:32:00 +0000</pubDate>
    </item>
    <item>
      <title>Good bye eZ Systems</title>
      <link>http://derickrethans.nl/good-bye-ez-systems.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="good_bye_ez_systems"/&gt;Good bye eZ Systems&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; London, UK&lt;/div&gt;
        &lt;div class="date"&gt;Tuesday, October 27th 2009, 10:36 GMT&lt;/div&gt;
      &lt;/div&gt;
      &lt;p&gt;During the past 6 years I've been working as a developer for &lt;a href="http://ez.no"&gt;eZ Systems&lt;/a&gt; — first as a developer on eZ Publish and later as project lead for &lt;a href="http://ezcomponents.org"&gt;eZ Components&lt;/a&gt;. Working on a project like &lt;a href="http://ezcomponents.org"&gt;eZ Components&lt;/a&gt; as lead was challenging and interesting and taught me many things. &lt;a href="http://ez.no"&gt;eZ Systems&lt;/a&gt; as a company is changing a lot, and now the time has come for me to move on and find something new and exciting to do. I've recently &lt;a href="/good_bye_norway_hello_london.php"&gt;moved to London&lt;/a&gt; to explore life from a different point of view, and that will now also include a search for a new challenge professionally. I will still be with eZ Systems for awhile longer to finish the next &lt;a href="http://ezcomponents.org"&gt;eZ Components&lt;/a&gt; release. If you think you can provide me with a new challenge, feel free to contact &lt;a href="/who.php"&gt;me&lt;/a&gt;.&lt;/p&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>200910271036</guid>
      <pubDate>Tue, 27 Oct 2009 10:36:00 +0000</pubDate>
    </item>
    <item>
      <title>CodeWorks and ZendCon</title>
      <link>http://derickrethans.nl/codeworks-and-zendcon.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="codeworks_and_zendcon"/&gt;CodeWorks and ZendCon&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; London, UK&lt;/div&gt;
        &lt;div class="date"&gt;Monday, October 19th 2009, 05:46 BST&lt;/div&gt;
      &lt;/div&gt;
      &lt;p&gt;&lt;a href="http://cw.mtacon.com/"&gt;CodeWorks&lt;/a&gt; was a blast, I recorded a few talks that I will be publishing through &lt;a href="http://vimeo.com"&gt;Vimeo&lt;/a&gt;. As teaser I have a recording of Scott MacVicar's &lt;a href="http://vimeo.com/7065312"&gt;PECL picks&lt;/a&gt; talk. I also have recordings of Brian Moon's Memcached talk, Chris Shiflett's Security-Centered Design talk and Sharon Levy's Web-Based Retrieval Demystified talk. With all the other random video material I am creating a compilation as well, but that will have to wait a bit more.&lt;/p&gt;
      &lt;p&gt;At the moment I am on my way to San Jose where I will speak on &lt;a href="http://xdebug.org"&gt;Xdebug&lt;/a&gt; and PHP's &lt;a href="http://phpdatebook.com"&gt;DateTime support&lt;/a&gt;. Xdebug 2.1 is now feature complete, and I will be working on getting all the open bugs resolved. A release before the end of the year seems likely.&lt;/p&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>200910190546</guid>
      <pubDate>Mon, 19 Oct 2009 04:46:00 +0000</pubDate>
    </item>
    <item>
      <title>Autumn Plans</title>
      <link>http://derickrethans.nl/autumn-plans.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="autumn_plans"/&gt;Autumn Plans&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; London, UK&lt;/div&gt;
        &lt;div class="date"&gt;Monday, September 14th 2009, 13:26 BST&lt;/div&gt;
      &lt;/div&gt;
      &lt;p&gt;I've been missing-in-action on my own blog for some time. Moving to London does that to you. Anyway, I've not been idle in the meanwhile at all, and been working on some cool side-projects. First of all I've been adding some features to &lt;a href="http://xdebug.org"&gt;Xdebug&lt;/a&gt; . Xdebug is now slow reaching beta-status for the 2.1 release. New feature will include proper PHP 5.3 support, variable tracing, "scream" support and other minor features.&lt;/p&gt;
      &lt;p&gt;Besides Xdebug I've also been hacking on PHP-GTK applications for my &lt;a href="http://wiki.openmoko.org/wiki/Main_Page"&gt;phone&lt;/a&gt; . The major new thing that I have now is a PHP-GTK twitter client that works like I want it... and I even use it on my desktop instead of all the other stuff that's out there. I will soon be publishing this client in my CVS repository.&lt;/p&gt;
      &lt;p&gt;Now that the conference season is starting again I'm working on improving several talks, as well as rewriting some parts for them. The first conference that I will be speaking at, are part of &lt;a href="http://mtabini.blogspot.com/"&gt;"Marco's Crazy PHP Conference Tour"&lt;/a&gt; aka &lt;a href="http://cw.mtacon.com"&gt;CodeWorks&lt;/a&gt; . I'll be giving three different talks here, one on "Debugging with &lt;a href="http://xdebug.org"&gt;Xdebug&lt;/a&gt; ", one on PHP's &lt;a href="http://phpdatebook.com"&gt;DateTime support&lt;/a&gt; and one on "Improving your development process" where I'll be talking about Test-Driven Development and other tricks associated by running a project. As CodeWorks is a bit like a rock-star tour, I'll be keeping a video blog of it somewhere on the intertubes.&lt;/p&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>200909141326</guid>
      <pubDate>Mon, 14 Sep 2009 12:26:00 +0000</pubDate>
    </item>
    <item>
      <title>Good bye Norway, Hello London</title>
      <link>http://derickrethans.nl/good-bye-norway-hello-london.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="good_bye_norway_hello_london"/&gt;Good bye Norway, Hello London&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; Skien, Norway&lt;/div&gt;
        &lt;div class="date"&gt;Sunday, June 21st 2009, 02:32 CEST&lt;/div&gt;
      &lt;/div&gt;
      &lt;p&gt;Today, at the longest day of the year at the &lt;a href="http://en.wikipedia.org/wiki/Solstice"&gt;summer solstice&lt;/a&gt; , I am making a bit change to my life. If you're following me on &lt;a href="http://twitter.com/derickr"&gt;twitter&lt;/a&gt; you probably already know what I'm up to. For everybody else, I am going to say good bye to Skien in Norway, and move to London (the one in England, and not the one in Ontario). Norway has been my home for the past five years, and I've had a great time exploring the nature as well as working at &lt;a href="http://ez.no"&gt;our&lt;/a&gt; office in &lt;a href="http://en.wikipedia.org/wiki/Skien"&gt;Skien&lt;/a&gt; . Skien is a nice place, but ... not the most interesting of cities in the world. From today I will be living in London to see what life will bring me there. I am both sad to leave Norway, but I am also excited to live in a cool new place like London. I'll have awesome house mates (Hi, Mr. Þorbjörnsson, Ms. Cherry and Mr. Ray!!), and something new to put my energy in. I will continue to work as project leader for &lt;a href="http://ezcomponents.org"&gt;eZ Components&lt;/a&gt; for &lt;a href="http://ez.no"&gt;eZ Systems&lt;/a&gt; and continue to make great software with Alexandru, &lt;a href="http://schlitt.info/opensource.html"&gt;Tobias&lt;/a&gt; , &lt;a href="http://kore-nordmann.de/blog"&gt;Kore&lt;/a&gt; and &lt;a href="http://sebastian-bergmann.de/"&gt;Sebastian&lt;/a&gt; . If you are about in London, let me know! We could go for a pint or something. See you there!&lt;/p&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>200906210232</guid>
      <pubDate>Sun, 21 Jun 2009 00:32:00 +0000</pubDate>
    </item>
    <item>
      <title>Debugging with multiple users</title>
      <link>http://derickrethans.nl/debugging-with-multiple-users.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="debugging_with_multiple_users"/&gt;Debugging with multiple users&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; Amsterdam, the Netherlands&lt;/div&gt;
        &lt;div class="date"&gt;Thursday, June 11th 2009, 10:47 CEST&lt;/div&gt;
      &lt;/div&gt;
      &lt;p&gt;As author of &lt;a href="http://xdebug.org"&gt;Xdebug&lt;/a&gt;, people ask me often the question how to handle the case in teams when there is one development server and multiple developers working on the same project on that server. Xdebug only allows you to specify &lt;em&gt;one&lt;/em&gt; IP address to connect to (through &lt;a href="http://xdebug.org/docs/remote#remote_host"&gt;xdebug.remote_host&lt;/a&gt; ) while doing &lt;a href="http://xdebug/docs/remote"&gt;remote debugging&lt;/a&gt;. It does not automatically connect back to the IP address that runs the browser the request the PHP scripts because of security reasons. You don't want everybody on the Internet to be able to run a debugging session against your code for example. There is no problem if all developers are working on a different project, because the xdebug.remote_host setting can be made for each directory (through Apache's .htaccess functionality). However, for the case where multiple developers work on the same code, the .htaccess trick won't work as the directory in which the code lives is the same.&lt;/p&gt;
      &lt;img src="/images/content/xdebug_logo.png" class="left" alt="xdebug_logo.png"/&gt;
      &lt;p&gt;Now, in order to solve the above mentioned issue, you will need to run a DBGp proxy. DBGp is the protocol, designed by &lt;a href="http://activestate.com"&gt;ActiveState&lt;/a&gt; and myself to facilitate communication between an IDE (such as &lt;a href="http://activestate.com/komodo"&gt;Komodo&lt;/a&gt;, or any of the other &lt;a href="http://xdebug.org/docs/remote#clients"&gt;listed clients&lt;/a&gt; ) and PHP+Xdebug. A DBGp proxy is a bit of software that acts as a redirector for DBGp streams. In order to make things work for multiple developers and one source base, you set Xdebug's xdebug.remote_host setting to the machine on which the DBGp proxy runs. This is most likely going to be on the same machine that acts as development server, so that the xdebug.remote_host setting should be set to "127.0.0.1" (i.e. localhost). The proxy server the listens for IDE connections. An IDE needs to register itself with the DBGp proxy by using the &lt;a href="http://xdebug.org/docs-dbgp.php#just-in-time-debugging-and-debugger-proxies"&gt;proxyinit command&lt;/a&gt;. This command requires an "idekey" that is a unique identifier for each client (IDE). Every developer should have its own unique idekey (I usually just pick my name), and this idekey should be configurable in the IDE. For Komodo, it's at Edit-&gt;Preferences-&gt;Debugger-&gt;Connection-&gt;"I am running a debugger proxy and Komodo should use it"-&gt;"Proxy Key". In Komodo you also need to select "a system-provided free port" in the same configuration panel. When initiating the debugging session from the browser with either XDEBUG_SESSION_START=session_name as GET/POST/COOKIE parameter, or export XDEBUG_CONFIG="idekey=session_name" from the comment line, make sure to change "session_name" to the idekey as configured in your IDE. (See &lt;a href="http://xdebug.org/docs/remote#starting"&gt;the documentation&lt;/a&gt; on how to set this up). The Xdebug &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/3960"&gt;Firefox extension&lt;/a&gt; also has a setting for this. You have to configure Xdebug's &lt;a href="http://xdebug.org/docs/remote#remote_host"&gt;xdebug.remote_host&lt;/a&gt; setting to the IP address of the machine that the proxy runs at. Xdebug itself does not see a difference between either the proxy and a normal IDE. But the proxy itself now knows because of the configured idekey on how to forward the requests and responses to the correct client.&lt;/p&gt;
      &lt;p&gt;You can find the DBGp proxy code as part of the &lt;strong&gt;python&lt;/strong&gt; remote debugging package that ActiveState &lt;a href="http://aspn.activestate.com/ASPN/Downloads/Komodo/RemoteDebugging"&gt;provides&lt;/a&gt;. By default it listens for IDE registrations at port 9001, and for Xdebug connections at port 9000. To run the proxy, do:&lt;/p&gt;
      &lt;pre&gt;tar -xvzf Komodo-PythonRemoteDebugging-5.1.3-28369-linux-x86_64.tar.gz
cd Komodo-PythonRemoteDebugging-5.1.3-28369-linux-x86_64
cd bin
./pydbgpproxy

&lt;/pre&gt;
      &lt;p&gt;This outputs:&lt;/p&gt;
      &lt;pre&gt;INFO: dbgp.proxy: starting proxy listeners.  appid: 30430
INFO: dbgp.proxy:     dbgp listener on 127.0.0.1:9000
INFO: dbgp.proxy:     IDE listener on  127.0.0.1:9001

&lt;/pre&gt;
      &lt;p&gt;Running a DBGp proxy also allows you to avoid NAT issues where (as seen from PHP+Xdebug on the server) all connections seem to come from the same IP (because your internal network is NATted). In this case, you can simple run the dbgp proxy on your NAT machine, configure xdebug.remote_host setting to the IP address of your NAT machine, and configure the IDEs to connect to the proxy running at &lt;NAT-machine&gt;:9001.&lt;/p&gt;
      &lt;p&gt;As a last note; there is a patch to allow the connect-back-to-requesting-IP-address functionality that is not available directly in Xdebug. This patch, written by Brian Shire and Lucas Nealan of &lt;a href="http://facebook.com"&gt;Facebook&lt;/a&gt; made its way into Xdebug 2.1. However, great care should be taken by using this functionality. It does not make the NAT situation as outlined above work however.&lt;/p&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>200906111047</guid>
      <pubDate>Thu, 11 Jun 2009 08:47:00 +0000</pubDate>
    </item>
    <item>
      <title>php|architect's Guide to Date and Time Programming</title>
      <link>http://derickrethans.nl/phparchitects-guide-to-date-and-time-programming.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="php_architect_s_guide_to_date_and_time_programming"/&gt;php|architect's Guide to Date and Time Programming&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; Skien, Norway&lt;/div&gt;
        &lt;div class="date"&gt;Wednesday, June 3rd 2009, 21:06 CEST&lt;/div&gt;
      &lt;/div&gt;
      &lt;img src="/images/content/datebook-cover.jpg" class="left" alt="datebook-cover.jpg"/&gt;
      &lt;p&gt;In the past year I've been working on a book, describing PHP's Date and Time functionality in great detail. It's now finally out under the name " &lt;a href="http://phpdatebook.com"&gt;php|architect's Guide to Date and Time Programming&lt;/a&gt; ". Look at the pretty cover! It's actually a picture I took some months ago from the church in &lt;a href="http://en.wikipedia.org/wiki/Skien"&gt;Skien&lt;/a&gt; , where I am &lt;em&gt;still&lt;/em&gt; living (more about that in a later post).&lt;/p&gt;
      &lt;p&gt;The book is devoted on helping you understanding dates and times, as well as how PHP deals with it. It explains how PHP parsers and reads dates and times in strings including possible pitfalls; timezones, their history, the annoyances and how to deal with them properly; formatting and displaying dates and times; and last but not least, how to handle intervals and iterating over time. There is more information on the &lt;a href="http://phparch.com/c/books/id/9780981034508"&gt;website&lt;/a&gt; where you can also buy this awesome book. And in case you're wondering "what? dates and times are really simple!", then this book is &lt;em&gt;definitely&lt;/em&gt; for you.&lt;/p&gt;
      &lt;p&gt;Rumour is that all attendees of the &lt;a href="http://phpconference.nl"&gt;Dutch PHP Conference&lt;/a&gt; will receive a copy with their tickets, if you're asking nicely I might even sign your copy! I'll be there to give a talk on "PHP on the D-BUS" and will show you how to talk to skype, GSM chips and other desktoppy things!&lt;/p&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>200906032106</guid>
      <pubDate>Wed, 03 Jun 2009 19:06:00 +0000</pubDate>
    </item>
  </channel>
</rss>
