title: proc_open() function returns 'PHP' is not recognized
body: <p>I am using <strong>Wamp</strong> I want to get output from the file opened with proc_open()</p>
  <pre><code>$cwd=null;
  $description = array(
      0 =&gt; array(&quot;pipe&quot;, &quot;r&quot;),
      1 =&gt; array(&quot;pipe&quot;, &quot;w&quot;),
      2 =&gt; array(&quot;file&quot;, &quot;error-output.txt&quot;, &quot;a&quot;) );
  
  $process = proc_open(&quot;php child.php&quot;, $description, $pipes, $cwd);
      fclose($pipes[0]);
      echo stream_get_contents($pipes[1]);
      fclose($pipes[1]);
      $return_value = proc_close($process);
      echo &quot;command returned $return_value\n&quot;;
  </code></pre>
  <p>but it returns 'PHP' is not recognized as an internal or external command in error-output.txt
  <img src="https://i.stack.imgur.com/tut9W.png" alt="enter image description here" /></p>
  <p>I have already included the path in environment variables and I can execute the command in <strong>CMD</strong>
  or <strong>VsCode</strong> terminal</p>
  <p><img src="https://i.stack.imgur.com/FK4O4.png" alt="enter image description here" /></p>
  <p>I have added the path in system variables
  <a href="https://i.stack.imgur.com/muHds.png" rel="nofollow noreferrer">System Variable picture here</a></p>
  <p>But running the command <strong>print_r(getenv('PATH'))</strong> in the <strong>child.php</strong> printed the following</p>
  <pre><code>C:\Program Files (x86)\Common Files\Oracle\Java\javapath;
  C:\WINDOWS\system32;
  C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;
  C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;
  C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;
  C:\WINDOWS\System32\OpenSSH\;
  C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;
  C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn\;
  C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;
  C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;
  C:\Program Files\Azure Data Studio\bin;
  E:\Softwares\NodeJs\;
  C:\WINDOWS\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps
  </code></pre>
  <p>So I don't know why the PHP path is not listed here
  and I also don't know how to give path explicitly in the argument of
  proc_open() as it accept an array for $env as official documentation says</p>
  <pre><code>$env = array('some_option' =&gt; 'aeiou');
  </code></pre>