如何从php脚本给Node.js服务器一个命令?

sorry to bother you, but I've been looking for answers and I couldn't find them anywhere... Well i'm a fresh dude in the field of javascript and node.js and here's my problem:

I've created an application based on the tutorial of socket.io - Here's the link to the completed project of their chat example. everything is working as it should, but I would really need to trigger somekind of a command while node server is running... command should be triggered via php script.

The command should trigger an emit event - so every client in our case would see a new message sent via php.

I saw couple of suggestions to do it from another server with php/using cURL. The problem is that I don't know how to fetch POST data sent from php to node.js server.

Any solution to command node with php is more than welcome and again i'm sorry to bother you :)

You can use a bridge to exchange data between NodeJS and PHP. You will need to implement a PHP server that exposes remote procedures and a NodeJS client that calls those remote procedures. You can send any data to the NodeJS application from PHP using these remote procedures.

Here are a few links to get you started:

http://bergie.iki.fi/blog/dnode-make_php_and_node-js_talk_to_each_other/

https://github.com/bergie/dnode-php