title: Run server-side js from php through exec()
body: <p>I have a site running on Apache/PHP, and as a matter of performance, I wrote a javascript to do a specific task.</p>
  
  <p>I have installed node.js on server, in order to run this javascript. When I call the script from the command line, it works fine. See the command below:</p>
  
  <pre><code>&gt; node myscript.js
  </code></pre>
  
  <p>But I need it to run from a php page, and I am trying to do this by calling the exec() PHP function, like this:</p>
  
  <pre><code>&lt;?php exec('node myscript.js &gt;/dev/null/ 2&gt;&amp;1 &amp;'); ?&gt;
  </code></pre>
  
  <p>...but it's not working.</p>
  
  <p>Am I doing something wrong? Is there another way to do what I want?</p>