<?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>Wed, 19 Jun 2013 03:34:31 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Software Gunslinger: PHP is meant to die]]></title>
      <guid>http://www.phpdeveloper.org/news/19417</guid>
      <link>http://www.phpdeveloper.org/news/19417</link>
      <description><![CDATA[<p>
In <a href="http://software-gunslinger.tumblr.com/post/47131406821/php-is-meant-to-die">this new post</a>, titled "PHP is meant to die", the author looks at one weakness he sees in the PHP language - how PHP handles long running scripts and functionality.
</p>
<blockquote>
In my opinion, a lot of the hatred that PHP receives misses the utter basic point: PHP is meant to die. It doesn't mean that a perfectly capable (to some extent) programming language will disappear into nothingness, it just means that your PHP code can't run forever. Now, <a href="http://php.net/releases/index.php">13 years after the first official release</a> in 2000, that concept still looks valid to me.
</blockquote>
<p>
He talks about some of the "dying" that PHP is good at (like making general website-related requests) but notes that if you try to have it do much more, PHP acts up. He points to the complexity of web-based applications and notes that, while PHP is good for some of it, it's not a fit for all functionality. He also covers the bringing of processes to the foreground that are best left in the background and how - despite the best of intentions - making a PHP daemon to solve the problem isn't a viable option.
</p>
<blockquote>
Do you see the pattern? I've inherited projects where PHP was used for daemons or other stuff that's not just regular websites (yes, I'm a hired keyboard), and all of them shared that same problem. No matter how good or clever your idea looked on paper, if you want to keep the processes running forever they will crash, and will do it really fast under load, because of known or unknown reasons. That's nothing you can really control, it's because PHP is meant to die. The basic implementation, the core feature of the language, is to be suicidal, no matter what.
</blockquote>
Link: http://software-gunslinger.tumblr.com/post/47131406821/php-is-meant-to-die]]></description>
      <pubDate>Fri, 05 Apr 2013 10:47:40 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Inviqa techPortal: New Relic for PHP: Web Application Performance Monitoring]]></title>
      <guid>http://www.phpdeveloper.org/news/19318</guid>
      <link>http://www.phpdeveloper.org/news/19318</link>
      <description><![CDATA[<p>
On the Inviqa techPortal today there's a new post talking about the New Relic monitoring service and what it has to <a href="http://techportal.inviqa.com/2013/03/14/new-relic-for-php-web-application-performance-monitoring/">offer PHP developers and their applications</a> to help them manage things like performance and resources.
</p>
<blockquote>
The performance of a web application plays a critical role in how an application is perceived by its users. It is important to measure it, identify the causes if it changes and react swiftly to any unexpected changes. This article describes an industry leading tool, New Relic, and how it can be used to monitor and improve your site performance. [...] New Relic is a real-time application monitoring service, providing various metrics about the performance of your production site, covering everything from application database queries through to the time it takes for the end-user to view a page. 
</blockquote>
<p>
They walk you through a "getting started" with the tool and how to get it running on your server - for PHP this means installing an "agent" extension and a local daemon for it to feed information back to. They then get into some of the data New Relic provides including application performance details, browser information, throughput and an <a href="https://en.wikipedia.org/wiki/Apdex">Apdex</a> score.
</p>]]></description>
      <pubDate>Fri, 15 Mar 2013 10:10:56 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Simas Toleikis' Blog: Writing a PHP daemon application]]></title>
      <guid>http://www.phpdeveloper.org/news/15768</guid>
      <link>http://www.phpdeveloper.org/news/15768</link>
      <description><![CDATA[<p>
<i>Simas Toleikis</i> has a new post today looking at a method he's found for creating <a href="http://simas.posterous.com/writing-a-php-daemon-application">a simple daemon application</a> in PHP. He gives you the basic outline of how it works (with a bit of code included) but not a specific example.
</p>
<blockquote>
There is a special group of applications that require a different PHP script execution model. [...] All of [these special] applications need to be run in the background as daemons - something that PHP was never designed/supposed to be good at. The plain C language is a weapon of choice when it comes to writing a daemon implementation, but then again, if the application in question does not depend on high performance and concurrency - PHP can do the job quite well.
</blockquote>
<p>
He talks about using the command line interface to run the scripts, creating the while loop to keep execution going and creating the non-blocking socket so that the script can accept new client connections.  He also mentions using <a href="http://upstart.ubuntu.com/">upstart</a> to run the script in the background and the <a href="http://pecl.php.net/package/proctitle/">proctitle</a> PECL extension to give the process a custom name in the process list. He also touches on log files and forking/parallel processing.
</p>]]></description>
      <pubDate>Wed, 19 Jan 2011 11:51:34 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Re-Cycled Air Blog: PHP Dark Arts: Daemonizing a Process]]></title>
      <guid>http://www.phpdeveloper.org/news/15356</guid>
      <link>http://www.phpdeveloper.org/news/15356</link>
      <description><![CDATA[<p>
On the Re-Cycled Air blog <i>Jack Slingerland</i> has posted another in his "Dark Arts" series looking at some of the lesser used PHP features. This time he focuses in on <a href="http://www.re-cycledair.com/php-dark-arts-daemonizing-a-process">daemonizing a process</a> by forking it off into the background.
</p>
<blockquote>
One of the many things you don't often do with PHP (actually, I'm not sure you do this much with any language) is daemonize a process.  A daemon is program that runs in the background (read more <a href="http://en.wikipedia.org/wiki/Daemon_%28computer_software%29">here</a>).  On Unix systems, processes are usually created by forking the init process and then manipulating the process to your liking.  To create a daemon though, you need to get the init process to adopt your process.  To do that, as soon as you fork the parent process, you kill the parent.  Since you child process is parent-less, the init process generally adopts it.  Once that happens, your process has been daemonized.
</blockquote>
<p>
He uses the <a href="http://php.net/pcntl_fork">pcntl_fork</a> function to spawn off the child process, detach it from a terminal window, create a ".pid" file so the system knows about it and then, of course, have the child script do something.
</p>]]></description>
      <pubDate>Fri, 29 Oct 2010 11:02:36 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Kevin Schroeder's Blog: You want to do WHAT with PHP? Chapter 8]]></title>
      <guid>http://www.phpdeveloper.org/news/15184</guid>
      <link>http://www.phpdeveloper.org/news/15184</link>
      <description><![CDATA[<p>
On his blog today <i>Kevin Schroeder</i> has the latest in a series of excerpts from his book "You Want to Do WHAT with PHP?" - a section of the <a href="http://www.eschrade.com/page/want-what-with-chapter-4c9b8841">chapter on daemons</a>.
</p>
<blockquote>
PHP is a language generally not suited for running daemons.  That said, PHP can do it, and in certain circumstances does it sufficiently for the job.  In this chapter we look at some of the things you need to know about to build a PHP-based daemon.  This excerpt doesn't feature any code, but it does set the foundation for why I think PHP is fine for daemons in some circumstances.
</blockquote>
<p>
The excerpt is mainly the first part of the chapter that just introduces the idea of daemons including some of the right and wrong uses, using the right tool for the job and how using PHP for a daemon can help with needs in a place where PHP might already be a norm.
</p>]]></description>
      <pubDate>Fri, 24 Sep 2010 12:39:17 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Content with Style: PHP worker processes with Beanstalk and Daemontools]]></title>
      <guid>http://www.phpdeveloper.org/news/14283</guid>
      <link>http://www.phpdeveloper.org/news/14283</link>
      <description><![CDATA[<p>
On the Content with Style blog there's a new post looking at <a href="http://www.contentwithstyle.co.uk/content/php-worker-processes-with-beanstalk-and-daemontools">creating a worker process</a> with PHP and the help of two other tools - <a href="http://kr.github.com/beanstalkd/">Beanstalkd</a> and <a href="http://cr.yp.to/daemontools.html">Daemontools</a>.
</p>
<blockquote>
Sometimes things just get too heavy for a straight forward approach. Memory usage might be too high or interaction might be delayed. In this case it might make sense to queue the task up for later execution. 
</blockquote>
<p>
The technique uses beanstalkd as a messaging queue to handle the requests based on the user's request via the interface the <a href="http://kr.github.com/beanstalkd/">beanstalkd library</a> provides. Then, to keep the queue running in the background and available, he uses daemotools to run a worker process. You can <a href="http://www.contentwithstyle.co.uk/resources/queue_test.zip">download the complete code</a> for a working example.
</p>]]></description>
      <pubDate>Thu, 01 Apr 2010 10:11:49 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Mark Karpeles' Blog: PHP DNS Daemon]]></title>
      <guid>http://www.phpdeveloper.org/news/11963</guid>
      <link>http://www.phpdeveloper.org/news/11963</link>
      <description><![CDATA[<p>
<i>Mark Karpeles</i> has created something that most people would think he's crazy for - a <a href="http://blog.magicaltux.net/2009/02/16/php-dns-daemon/">DNS daemon written in PHP</a>:
</p>
<blockquote>
If you want to tell me I'm crazy, you can post it in a comment here, it makes me happy. I had some reasons to dislike bind9 which finally made me write my own DNS daemon, and I'll explain that here. My need was to have a stable dynamic DNS server working in most environments, with an easy to configure master/slave relationship (with realtime synchronization), and a way to change records instantly from PHP...
</blockquote>
<p>
Rather than using the (slightly unstable) dlz technology to pull the information from a MySQL database, he opted to roll his own that includes support for:
</p>
<ul>
<li>RFC 1035 standards
<li>realtime data update
<li>slave/master relationship (with a keepalive connection)
</ul>
<p>
Want to try it out for yourself? <a href="mailto:mark@hell.ne.jp">Drop him a line</a> and ask about it!
</p>
<p>
He's also <a href="http://blog.magicaltux.net/2009/02/18/php-dns-daemon-performances/">run some statistics</a> on the performance of the daemon as compared to the standard BIND installation and <a href="http://blog.magicaltux.net/2009/02/19/your-own-php-dns-daemon/">come up with some instructions</a> on how you can install and configure your own instance.
</p>]]></description>
      <pubDate>Tue, 17 Feb 2009 12:06:24 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Mark Karpeles' Blog: proctitle: a new step for pinetd]]></title>
      <guid>http://www.phpdeveloper.org/news/11793</guid>
      <link>http://www.phpdeveloper.org/news/11793</link>
      <description><![CDATA[<p>
If you've ever worked with forking processes in PHP, you know things can get a little difficult when you have more than one process going at a time. Identification can become a hassle, especially if you need to kill one off because of performance issues. If you've found yourself in this spot before, you might want to check out <a href="http://blog.magicaltux.net/2009/01/21/proctitle-a-new-step-for-pinetd/">this update</a> <i>Mark Karpeles</i> has made to his <a href="http://www.pinetd.net/">pinetd</a> project to allow for naming of those forked processes.
</p>
<blockquote>
Ever wanted to give meaningful names to your processes when you pcntl_fork() with PHP ? proctitle is the extension you're looking for!
Adapted from <a href="http://bugs.php.net/29479">bug report #29479</a> and code initially wrote by <a href="http://en.wikipedia.org/wiki/User:Midom">Midom</a> for Wikipedia, the proctitle extension allows for a process to change its own displayed title in the system's process list.
</blockquote>
<p>
The extension (seen in action <a href="http://blog.magicaltux.net/wp-content/uploads/2009/01/viva_pinetd1.png">here</a>) is an interface for making different sorts of daemons, including the ability to give them names. You can check out the project <a href="http://ookoo.org/svn/proctitle/">here</a>.
</p>]]></description>
      <pubDate>Thu, 22 Jan 2009 11:12:17 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Kevin van Zonneveld's Blog: Create daemons in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/11717</guid>
      <link>http://www.phpdeveloper.org/news/11717</link>
      <description><![CDATA[<p>
In a new post to his blog <i>Kevin van Zonneveld</i> talks about <a href="http://kevin.vanzonneveld.net/techblog/article/create_daemons_in_php/">making daemons</a>, backend scripts that run independent of a web server.
</p>
<blockquote>
Everyone knows PHP can be used to create websites. But it can also be used to create desktop applications and commandline tools. And now with a class called System_Daemon, you can even create daemons using nothing but PHP. And did I mention it was easy?
</blockquote>
<p>
He starts with a definition ("a linux program that runs in the background") and why PHP makes a good language choice for creating them. His example uses the <a href="http://pear.php.net/package/System_Daemon">System_Daemon</a> PEAR class to do most of the heavy lifting. To use it, you only need to include it at the top of the script and make two calls to the setOption and start methods to have the rest of the code all set to run as a daemon.
</p>
<p>
The example code sets up a daemon complete with support for command-line arguments and the ability to be run from init.d on the local system.
</p>]]></description>
      <pubDate>Mon, 12 Jan 2009 08:47:31 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[JSLabs Blog:  An ftp server written in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/7377</guid>
      <link>http://www.phpdeveloper.org/news/7377</link>
      <description><![CDATA[<p>
In a <a href="http://www.whenpenguinsattack.com/2007/03/05/an-ftp-server-written-in-php/">new post</a> to the JSLabs blog today, <i>Justin Silverton</i> mentions a FTP server that's been created entirely in PHP - <a href="http://www.jaslabs.com/downloads">nanoFTP</a>.
</p>
<blockquote>
nanoFTPd is an ftp daemon written in php. as of version 4.2.0, php supports the command-line interface (stable since 4.3.0), which nanoFTPd relies on. nanoFTPd is modular, so it's easy to add custom modules and other stuff, like different database interfaces (currently supports mysql and postgresql).
</blockquote>
<p>
Features of <a href="http://www.jaslabs.com/downloads">the app</a> include user authentication via a database or text file, dynamic IP support, and most of the usual FTP goodies you're used to in a server. You'll need at least PHP 4.2.0 to get it up and running, but configuration is simple and installations it just as easy. You can grab the software from <a href="http://www.jaslabs.com/downloads">their website</a>.
</p>]]></description>
      <pubDate>Mon, 05 Mar 2007 08:27:00 -0600</pubDate>
    </item>
  </channel>
</rss>
