News Feed
Sections




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

Kevin van Zonneveld's Blog:
Create daemons in PHP
January 12, 2009 @ 08:47:31

In a new post to his blog Kevin van Zonneveld talks about making daemons, backend scripts that run independent of a web server.

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?

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 System_Daemon 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.

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.

1 comment voice your opinion now!
tutorial daemon shell script systemdaemon pear package


blog comments powered by Disqus

Similar Posts

PHPRiot.com: Zend Framework 101: Zend_Loader

Matthew Weir O'Phinney's Blog: Phly_Struct? no, Phly_Hash...

PHPRefresh.com: Managing Sessions and State with PHP

PHP in Action Blog: Using Selenium with SimpleTest

NETTUTS.com: CodeIgniter from Scratch: Shopping Cart


Community Events





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


community introduction interview zendserver symfony series list development bugfix release podcast laravel api language tips threedevsandamaybe deployment framework conference code

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