Sources


GitHub: github.com/kakserpom/phpdaemon

You may obtain phpDaemon by cloning the repository:
$

Or by downloading recent package:
$

Do not forget to install:

  1. PHP >= 5.6 non-zts
  2. libevent 2.last and pecl-event 1.6.0
And optional:
  1. pecl-eio to increase filesystem I/O performance
  2. pecl-proctitle for neat proc. titles like «phpd: worker process» (not required for PHP >= 5.5)
  3. pecl-inotify for productive filesystem monitoring

$

CentOS/RedHat 6.4 installation


First of all, you have to install the required tools. Run command -
$

Install php 5.5. You need to install Remi & Epel Repository because standard repository contains the old version of php. Let's do it
Install Remi & Epel Repository on RHEL/CentOS 6.4-6.0 - 32 Bit
$
$

Install Remi & Epel Repository on RHEL/CentOS 6.4-6.0 - 64 Bit
$
$

Install php -
$

Now have not working RPM packages for libevent 2. We need to install this from source. Download last version from http://libevent.org/, config and install libevent 2.
$
$
$
$
$
$

Next, install pecl modules. Answer all of the questions answered in default and add this modules to config files
$
#

The following points need to tell more. Now PHP does not yet support control the boot order of libraries. For work correctly event and eio pecl-extensions need sockets extension. In RedHat-like extensions are loaded in alphabetical order. That's why we call them z-event.ini and z-eio.ini.
#
#
Ctrl + D - (exit from su mod).


Set date.timezone in php.ini. Edit file /etc/php.ini. Uncomment and edit string ;date.timezone = to your timezone (e.g. date.timezone = UTC )
$

Next, prepare a directory to install phpDaemon.
$
$
$


Install phpDaemon.
$
$

Copy example configuration file.
$

Create symlink in /usr/bin/ for enable easy run daemon command(e.g. sudo phpd start)
$
Trying to start
$
--verbose-tty=1 - tell to daemon log messages to STDOUT. If you get as a result of something like this:

[PHPD] Loaded config file: '/opt/phpdaemon/conf/phpd.conf' [PHPD] Loaded config file: 'conf/conf.d/ExampleJabberBot.conf' [PHPD] Loaded config file: 'conf/conf.d/FastCGI.conf' [PHPD] Loaded config file: 'conf/conf.d/FlashpolicyServer.conf' [PHPD] Loaded config file: 'conf/conf.d/HTTPServer.conf' [PHPD] Loaded config file: 'conf/conf.d/IdentServer.conf' [PHPD] Loaded config file: 'conf/conf.d/SSL-sample.conf' [PHPD] Loaded config file: 'conf/conf.d/WebSocketServer.conf' [PHPD] [START] phpDaemon with pid-file '/var/run/phpd.pid' is running already (PID 28308)
my congratulations! The daemon is running.

Ubuntu installation


This part of manual describes install, config and running example applications by phpDaemon. To install this will be used clear Ubuntu 13.04. Follow me.

First of all, you have to install the required tools. Run command -
$

Install php 5.5
$

Next, install pecl modules. Answer all of the questions answered in default and add this modules to config files
$
#
#
#

Make symlink
#
#
Ctrl + D - (exit from su mod).


Next, prepare a directory to install phpDaemon.
$
$
$


Install phpDaemon.
$
$

Copy example configuration file.
$

Aliases for phpd:
$
This alias allow local aliases with sudo
$

Trying to start
$
--verbose-tty=1 - tell to daemon log messages to STDOUT. If you get as a result of something like this:

[PHPD] Loaded config file: '/opt/phpdaemon/conf/phpd.conf' [PHPD] Loaded config file: 'conf/conf.d/ExampleJabberBot.conf' [PHPD] Loaded config file: 'conf/conf.d/FastCGI.conf' [PHPD] Loaded config file: 'conf/conf.d/FlashpolicyServer.conf' [PHPD] Loaded config file: 'conf/conf.d/HTTPServer.conf' [PHPD] Loaded config file: 'conf/conf.d/IdentServer.conf' [PHPD] Loaded config file: 'conf/conf.d/SSL-sample.conf' [PHPD] Loaded config file: 'conf/conf.d/WebSocketServer.conf' [PHPD] [START] phpDaemon with pid-file '/var/run/phpd.pid' is running already (PID 28308)
my congratulations! The daemon is running.

Next, add an alias to a file so that they are available after reload
$
$

Gentoo linux installation

You can install PHPDaemon easy with special layman overlay.

To add this overlay you need to add this url to your overlays section of layman.cfg:

$

It will look something like this:

overlays : http://www.gentoo.org/proj/en/overlays/repositories.xml https://github.com/lexa-uw/layman-phpdaemon/blob/master/layman.xml

Then you need to fetch layman overlays list with:

$

And then you can add overlay:

$

Final step is simply run:

$

Add phpdaemon to autoload:

$

More information about installation for different versions of the www-servers/phpdaemon you can find on official wiki page.

Composer installation

Add section to requirement in your composer.json

"require" : { "kakserpom/phpdaemon" : "dev-master" }

More information on packagist.

Fork me on GitHub