<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Thu, 23 May 2013 05:00:43 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Lorna Mitchell: PHP and Gearman: Unable to connect after upgrade]]></title>
      <guid>http://www.phpdeveloper.org/news/19252</guid>
      <link>http://www.phpdeveloper.org/news/19252</link>
      <description><![CDATA[<p>
<i>Lorna Mitchell</i> has shared some advice about <a href="http://www.lornajane.net/posts/2013/php-and-gearman-unable-to-connect-after-upgrade">correcting an issue with PHP and Gearman</a> after she did an upgrade via PECL.
</p>
<blockquote>
I upgraded PHP and related pecl modules on my development machine today, and ran into a problem with Gearman. Actually I ran into more than one! Firstly the challenge of getting the newest pecl version working with a gearman version. Then an error where my existing PHP application couldn't connect to gearman after upgrade.
</blockquote>
<p>
Running on Ubuntu, she found <a href="http://www.phamviet.net/2012/10/10/ubuntu-php-5-4-x-and-gearman-troubleshooting/">this tutorial</a> helpful in getting Gearman back into a working state and installed (version 1.1.1). The "unable to connect" error turned out to be a change in how the Gearman connection needed to be made - the addition of a port to the connection string made things work again. 
</p>]]></description>
      <pubDate>Thu, 28 Feb 2013 12:55:48 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Community News: Atlanta PHP November 2012 Meeting - The Magical World of Gearman]]></title>
      <guid>http://www.phpdeveloper.org/news/18626</guid>
      <link>http://www.phpdeveloper.org/news/18626</link>
      <description><![CDATA[<p>
The Atlanta PHP User Group has announced their November meeting - <i>Brian Moon</i> talking about <a href="http://atlantaphp.org/2012/10/november-2012-meeting/">"The Magical World of Gearman"</a>:
</p>
<blockquote>
Gearman is a simple and robust tool for distributing asynchronous or offline work across a large number of worker boxes. Gearman will let you run a simple asynchronous task in only a few lines of code (and in many languages). This talk will focus on what Gearman is, some use cases for it, and how you can quickly start using it with PHP.
</blockquote>
<p>
The meeting is being held at <a href="http://www.thompsontechnologies.com/">Thompson Technologies</a> Thursday, November 1st from 7-9pm. A mini-talk from <i>Scott Lively</i> about PHP_CodeSniffer will also be given.
</p>
<p>
Have an upcoming user group meeting you'd like announced? <a href="mailto:info@phpdeveloper.org">let us know</a>!
</p>]]></description>
      <pubDate>Thu, 18 Oct 2012 11:55:45 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Vance Lucas: Handling Exceptions in Gearman Tasks (Even Background Ones)]]></title>
      <guid>http://www.phpdeveloper.org/news/18314</guid>
      <link>http://www.phpdeveloper.org/news/18314</link>
      <description><![CDATA[<p>
<i>Vance Lucas</i> has a quick new post to his site showing you how to <a href="http://www.vancelucas.com/blog/handling-exceptions-in-gearman-tasks-even-background-ones/">handle exceptions in Gearman tasks</a> so that they can be logged correctly as a failure.
</p>
<blockquote>
I recently had some issues with Gearman tasks throwing exceptions and killing the whole Gearman daemon. This made it nearly impossible to trace errors back to their origin, because the logged exception stack trace didn't provide much useful information, because it just logged where it failed in Gearman. [...] The only other place to add code that will catch exceptions for all jobs run is in the GearmanWorker::addFunction method. 
</blockquote>
<p>
To solve the issue, he ends up passing in a closure that takes in the $task and wraps its execution in a try/catch to handle the exception correctly. This is then thrown to a custom exception handler and logged for future diagnosis.
</p>]]></description>
      <pubDate>Fri, 03 Aug 2012 08:28:25 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[/Dev/Hell Podcast: Episode 5 - The Hammer That Is PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17502</guid>
      <link>http://www.phpdeveloper.org/news/17502</link>
      <description><![CDATA[<p>
The /dev/hell podcast has released their latest episode <a href="http://devhell.info/post/2012-02-03/the-hammer-that-is-php/">with special guest Brian Moon</a> (of <a href="http://dealnews.com/">dealnews</a>).
</p>
<blockquote>
In our fifth episode we speak to our first ever guest Brian Moon, ancient PHP elder of dealnews and someone who has probably forgotten more about PHP than our two hosts will ever know. [...] In this episode we talk about dealnews, how they use PHP (and how they also use it in some interesting ways), and his thoughts on issues like concurrency and evented systems. We also cover features of PHP that allowed for some major changes and approaches they used in the code base for the site.
</blockquote>
<p>
Other technologies discussed include <a href="http://gearman.org/">Gearman</a>, <a href="https://nodejs.org/">Node.js</a>, <a href="http://www.squid-cache.org/">Squid</a> and <a href="https://www.varnish-cache.org/">Varnish</a>. You can listen to this latest episode either via the <a href="http://devhell.info/post/2012-02-03/the-hammer-that-is-php/">in-page player</a> or by <a href="http://devhell.s3.amazonaws.com/ep5-64mono.mp3">downloading the mp3 directly</a>.
</p>]]></description>
      <pubDate>Mon, 06 Feb 2012 12:03:42 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Ralph Schindler's Blog: Compiling Gearman (or anything) for Zend Server CE on Snow Leopard]]></title>
      <guid>http://www.phpdeveloper.org/news/17363</guid>
      <link>http://www.phpdeveloper.org/news/17363</link>
      <description><![CDATA[<p>
<i>Ralph Schindler</i> has a new post to his blog today detailing the process you'll need to <a href="http://ralphschindler.com/2010/05/12/compiling-gearman-or-anything-for-zend-server-ce-on-snow-leopard">compile Gearman (or just about anything)</a> on a Zend Server CE install on Snow Leopard.
</p>
<blockquote>
Zend Server CE for Mac (as of this writing), comes compiled as an i386 executable only. This includes the PHP binary, php library, and apache binaries that come shipped with ZSCE. While ZSCE works great out the box with all the provided extensions, you might find that you want some additional 3rd party PHP extensions compiled/linked into this stack. That's where things get a little confusing, and in this post, we'll look at how to install the gearman extension.
</blockquote>
<p>
He give two methods - the easy way where you can export a CFLAGS setting to compile with multiple architectures or the harder way (that works for Gearman), building static libraries. The full list of commands (and some example output) is included in <a href="http://ralphschindler.com/2010/05/12/compiling-gearman-or-anything-for-zend-server-ce-on-snow-leopard">the post</a>. In the comments there's also an example of the install if you're using <a href="http://www.macports.org">Macports</a>.
</p>]]></description>
      <pubDate>Mon, 09 Jan 2012 10:59:35 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Wells' Blog: Kohana and Gearman - Practical Multitasking]]></title>
      <guid>http://www.phpdeveloper.org/news/16791</guid>
      <link>http://www.phpdeveloper.org/news/16791</link>
      <description><![CDATA[<p>
<i>Matthew Wells</i> has a new post that looks at <a href="http://www.ninjapenguin.co.uk/blog/2011/08/29/kohana-and-gearman-practical-multitasking/">combining Kohana and Gearman</a> to create a system to handle large data processing without slowing down the rest of the application.
</p>
<blockquote>
A commonly identified bottleneck arises when dealing with large, 'expensive' data. This is commonly seen when an application posts a large volume of well structured data to the API (that some process must be carried out upon), before some form of structured receipt is then returned as a request response. [...] Analysing such a request tends to show high PHP CPU usage with lower database consumption. [...] The structured nature of data exchanged via an API means that we can, relatively simply and reliably, divide the submitted data and process it simultaneously with the help of a great tool called Gearman.
</blockquote>
<p>
He walks you through the entire process including his initial thoughts on what the system should be and how it should behave when the requests are made. He <a href="https://github.com/ninjapenguin/AntFarm/blob/master/application/classes/controller/farmable.php">shares the code</a> he used to implement the system - a simple worker that processes part of the request and returns the results. The command-line calls to run the worker manually for testing are also included.
</p>]]></description>
      <pubDate>Tue, 30 Aug 2011 11:39:11 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Dave Marshall' Blog: Asynchronous cache priming with progress bars via Gearman, Memcache and Dojo]]></title>
      <guid>http://www.phpdeveloper.org/news/16141</guid>
      <link>http://www.phpdeveloper.org/news/16141</link>
      <description><![CDATA[<p>
<i>Dave Marshall</i> has written up a new post showing how he's used memcache, Gearman and Dojo to create an <a href="http://www.davedevelopment.co.uk/2011/04/04/asynchronous-cache-priming-with-progress-bars-via-gearman-memcache-and-dojo/">asynchronous progress bar</a> he uses when generating large reports.
</p>
<blockquote>
I have a (highly optimised) report that takes way too long to generate, up to around 30 seconds. [There's] too many variables to prime caches for every possible combination [and] personally, I don't think the browsers inbuilt progress bar is enough feedback for todays web users.
</blockquote>
<p>
He generates the data into <a href="http://memcached.org/">memcache</a> when the user requests it and uses the Gearman worker processes to handle requests for data that doesn't yet exist. The progress bar is a part of <a href="http://dojotoolkit.org/">Dojo</a> and uses the <a href="http://docs.dojocampus.org/dijit/ProgressBar">dijit.ProgressBar</a> widget to keep checking the progress of the build. This way the user can even leave the page and come back if the process takes too long with no threat to the generating report. You can find all of his code he's used to make it happen <a href="https://github.com/davedevelopment/async-demo">on his github account</a>.
</p>]]></description>
      <pubDate>Mon, 04 Apr 2011 10:18:20 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: Watermarks in our images with PHP and Gearman]]></title>
      <guid>http://www.phpdeveloper.org/news/16007</guid>
      <link>http://www.phpdeveloper.org/news/16007</link>
      <description><![CDATA[<p>
<i>Gonzalo Ayuso</i> had <a href="http://phpdeveloper.org/news/15975">previously shown</a> how to dynamically add watermarks to your images with the help of a mod_rewrite rule. One of the side effects of this is that, with a high load on your server, things can get bogged down quite quickly. His alternative? Add the watermarks to your images <a href="http://gonzalo123.wordpress.com/2011/03/07/watermarks-in-our-images-with-php-and-gearman/">with Gearman</a> workers.
</p>
<blockquote>
In this second solution I will use a <a href="http://gearman.org/">gearman</a> worker to generate the watermarks. The benefits of <a href="http://gearman.org/?id=gearman_php_extension">gearman</a> is the possibility of use a <a href="http://www.php.net/manual/en/gearmanclient.addserver.php">pool</a> of workers. We can add/remove workers if our application scales. Those workers can be placed even at different hosts, and we can swap easily from one configuration to another.
</blockquote>
<p>
He includes some sample scripts to illustrate the process - a Gearman client that'll call the watermarking process and a worker that takes in the image and transforms it with GD to add a new layer for the watermark.
</p>]]></description>
      <pubDate>Mon, 07 Mar 2011 12:12:17 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Lorna Mitchell's Blog: Dealing with MySQL Gone Away in Zend Framework]]></title>
      <guid>http://www.phpdeveloper.org/news/15977</guid>
      <link>http://www.phpdeveloper.org/news/15977</link>
      <description><![CDATA[<p>
<i>Lorna Mitchell</i> has a <a href="http://www.lornajane.net/posts/2011/Dealing-with-MySQL-Gone-Away-in-Zend-Framework">(very) quick tip</a> for those using the Zend Framework with a MySQL database. Sometimes the inevitable "MySQL server has gone away" error will pop up - her tip shows you how to deal with it correctly in a long-running application.
</p>
<blockquote>
The [Gearman] worker is a Zend Framework application, run from the CLI, and it seemed like the Zend_Db_Adapter had no way of knowing when MySQL had let go of its end of the connection. I tried a few different things, including Zend_Db_Adapter::getConnection(), but without success - until I dug through the source code (with some help from a friend) and realised that ZF was not reconnecting at all if it thought it already had a connection. 
</blockquote>
<p>
She ended up putting a connection into a registry and, when the process was done, forcing the connection to close. This made the next worker in the queue forcefully open another new connection rather than having the same one pending for (possibly) days at a time.
</p>]]></description>
      <pubDate>Tue, 01 Mar 2011 10:03:01 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Lorna Mitchell's Blog: Using Gearman from PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/15912</guid>
      <link>http://www.phpdeveloper.org/news/15912</link>
      <description><![CDATA[<p>
<i>Lorna Mitchell</i> has a new post today about using a popular backend processing tool, <a href="http://www.lornajane.net/posts/2011/Using-Gearman-from-PHP">Gearman</a>, from inside of PHP. Her example gives a <a href="http://www.lornajane.net/posts/2011/Using-Gearman-from-PHP">full overview</a> of how to add a new job and write the worker for it to make things happen.
</p>
<blockquote>
Basically, this application generates some PDFs from a variety of data sources, makes images, and emails it. Since the whole data processing, image handling, PDF generation process is fairly heavy, I'm putting the requests to generate these onto a gearman queue and having some workers process the jobs.
</blockquote>
<p>
You'll need to have the Gearman server and extension installed (<a href="http://www.lornajane.net/posts/2011/Installing-Gearman-for-PHP-and-Ubuntu">sample instructions here for Ubuntu</a>) to use the sample code she gives using the Gearman_Client and GearmanWorker objects to create the pieces of the puzzle. You can find out more about the Gearman PECL extension <a href="http://pecl.php.net/package/gearman">here</a>.
</p>]]></description>
      <pubDate>Wed, 16 Feb 2011 09:51:07 -0600</pubDate>
    </item>
  </channel>
</rss>
