for perl there is no library, for php there are a few including the php-emitter.
For me nothing worked really well, so i decided to communicate with my server the unix way.
in production i use php -> node client -> node server
where php and the client running on the same server.
it run's very well and serves over 500.000 users monthly.

here is my node.js script to open a unix socket.
Every line the socket gets will be emitted

var net = require('net');  
var fs = require('fs');

//do the connect
var io = require('').connect(  
        'http://other_server', {
        port: 80

if (fs.existsSync('/tmp/node_socket')) {  

var server = net.createServer(function(con) {  
    con.on('data', function(data) {
        if(typeof data != 'undefined' && data != null)
            var str = data.toString();
            var arr = str.split("\n");
            arr.forEach(function(string) {
                 if ( string ) {
                     console.log('Data received by socket: ' + string);
                     io.emit('something', JSON.parse(string));




in php i simply do

$sock = stream_socket_client('unix:///tmp/node_socket', $errno, $errstr);
fwrite($sock, 'SOME string'."\n");  

use addClass if you have many elements in favor of .hide() and removeClass for show();

.hide {


a javascript object can't be used like obj.each(function()...
but we can use jquery's each function:

$.each(obj, function( i, val ) {
  console.log(i+": "+val);