title: Run exec() in PHP as a different Windows user?
body: <p>I'm trying to create a Cordova project in a PHP script, using :</p>
  
  <pre><code>$command = "cordova create test";
  exec($command);
  </code></pre>
  
  <p>This doesn't work because the <code>cordova</code> command (which is a NodeJS plugin) is only available to the normal Windows user, and not the local system account that runs the Apache service (so also not to PHP).</p>
  
  <p>I found some answers on here that relate to linux, but I need this to work on Windows.</p>
  
  <p>Is there a way to change the user that runs <code>exec()</code> to my normal Windows account?</p>
  
  <p><strong><em>UPDATE</em></strong></p>
  
  <p>After adding <code>C:\Users\&lt;ACCOUNTNAME&gt;\AppData\Roaming\npm</code> to the <code>PATH</code> variable it works. That's where the <code>cordova.cmd</code> file is located (on my system).</p>