phpdaemon Install on Ubuntu 12.04

I recently wanted to use PHP for a service running on a Linux machine. After looking at several projects I decided to dig deeper into phpdaemon. The source is available on GitHub (https://github.com/kakserpom/phpdaemon). There is some documentation in English and some in Russian. The English documentation is less than ideal. I fought with the code for some time before getting it installed and running. Here is what I did to get everything working under Ubuntu Linux 12.04.

  • Download current source from GitHub
  • https://github.com/kakserpom/phpdaemon/downloads

  • Extract source to /opt
  • Make sure you have /opt/phpdaemon directory with conf, lib, app-*, and application directories
  • Link phpd to somewhere in your PATH
  • ln -s /opt/phpdaemon/bin/phpd /usr/local/bin/phpd

  • Create config files
  • mkdir /etc/phpdaemon
    cp -a /opt/phpdaemon/conf/* /etc/phpdaemon

  • Rename default config file
  • mv /etc/phpdaemon/phpd.conf.default /etc/phpdaemon/phpd.conf

  • Adjust user and group settings in /etc/phpdaemon/phpd.conf
  • Install required PECL libraries
  • sudo apt-get -V install php-pear libevent-dev build-essential
    sudo pecl install libevent-beta eio proctitle-alpha

  • Create /etc/php5/conf.d/pecl.ini, add these lines
    extension=libevent.so
    extension=eio.so
    extension=proctitle.so
    to the file
  • Ensure Apache (or any other web server) is not running
  • Install the attached init script to /etc/init.d/phpd
  • Start phpdaemon
  • sudo service phpd start

Now you should be able to view http://127.0.0.1/Example/ in a web browser.