なんかデーモンっぽいものを作らないといけないなぁということになって、それまでCakePHPでシステムを作っていたので、やっぱりデーモンもPHPかということになって、作ってみたら意外と簡単でしたよという話。 まぁ、デーモンのようなものをPHPで作らなくても良いでしょうという意見もあると思うのですが、バッチリLAMP環境ができあがっている昨今、やっぱりPHPでやれちゃうというのは楽なんですよね。 PHPでデーモンを作るには、POSIXに対応したPHP環境と、System_DaemonというPEARライブラリが必要です。あと、System_Daemonからログを出すためにLogというPEARライブラリも。 CentOS+remiとかでyumインストールしたPHPは、—disable-posixというオプション付でコンパイルされているので、そのままの状態ではデーモンを作っても実行時にエラーとなって