tags:

views:

51

answers:

1

I wish to add real time status update notification to a kohanaPHP application with MySQL database i'm developing using node.js, while looking around, i could not find any tutorials about integrating node.js in PHP, i will like to know if its possible and how can it be done and what type of servers should i host the php website on. From what i got its seems node.js does not work on Apache servers. i'll be grateful for help.

A: 

First: You don't run node in any Apache or other web server. It's its own server. So you need to implement data exchange between your Apache/PHP server and node.

You can call your node program via a HTTP request from PHP as soon as something changes and push the new data into your node.

That way you don't need access to MySQL for node, which is not available yet anyway.

Techpriester
is there any example out there where i can get some inside how to do this data exchange Apache/PHP server with node? and how do i store the status the users post? am i to use node to store the data into the DB or PHP, thanks for the reply
Well, node is a web server itself, so you can talk to it via HTTP requests. PHP can execute such requests. Node can, as of current versions, not access classic database systems like mysql. So. PHP has to do that. You just need to send the data to node via HTTP as soon as you store it into your DB.
Techpriester
is there any example codes i can look and learn from ?
There are a couple of MySQL modules available for Node.js now amongst others. Check out the database modules list here: http://wiki.github.com/ry/node/modules#database
Kynth