News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Simas Toleikis' Blog:
Writing a PHP daemon application
January 19, 2011 @ 11:51:34

Simas Toleikis has a new post today looking at a method he's found for creating a simple daemon application in PHP. He gives you the basic outline of how it works (with a bit of code included) but not a specific example.

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.

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 upstart to run the script in the background and the proctitle PECL extension to give the process a custom name in the process list. He also touches on log files and forking/parallel processing.

0 comments voice your opinion now!
daemon application tutorial proctitle cli upstart


blog comments powered by Disqus

Similar Posts

Zend Developer Zone: How to avoid Identity Theft in Zend Framework with Zend Auth

Paperbagcoder: MVC and PHP

TotalPHP.com: Creating a text or csv file of information from your database

Dutch Web Alliance: The definitive remote debug and unittest with PHPStorm guide: part 5

Codeception.com: Headless Browser Testing with Selenium2 and PhantomJS


Community Events











Don't see your event here?
Let us know!


language hhvm series hack composer release package symfony2 component introduction podcast security performance application database install framework facebook opinion unittest

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework