NodeJS with PHP <p>I am a PHP developer who just started learning Node.js and I saw this video: <a href="https://www.youtube.com/watch?v=_D2w0voFlEk" rel="nofollow">https://www.youtube.com/watch?v=_D2w0voFlEk</a> where it is explained that a html file can be given as response to the browser which is fine.</p> <p><strong>Now, my question:</strong></p> <p>If I am running Node.js and PHP in the same server and if the user visits my website, the request goes to nodejs script running in my server. Now, can I process the request in NodeJS and then give a PHP file as a response (after processing on server side) instead of .html file</p> <p>An outline of what I mean is:</p> <p>Client Request-> NodeJS server->NodeJS script->PHP server->PHP script->Client Response</p> <p>Its like stacking of 2 servers.</p> <p><strong>Why I was thinking of this..</strong></p> <p>I am making a social networking website where I already made most of my code in PHP and now I am working on real time communications where I do video/audio conferencing, text chat, etc. So, I am planning to use WebRTC and Websockets for this and found many websites telling that NodeJS is the best way to go about when taking Real Time communications to consideration. </p> <p>But, if I have to do it, I have to change all my code from PHP to NodeJS which is not a good option. So, I thought why not run PHP server inside NodeJS server.</p> <p>Thanks in advance</p> <p>I did refer this question by the way: <a href="http://stackoverflow.com/questions/2808125/recommendation-for-integrating-nodejs-with-php-application">Recommendation for integrating nodejs with php application</a> and felt my case is a bit different.</p>