title: PHP, system() and inheriting PATH to script
body: <p>Php pages on <code>/var/www/mypage</code> say <code>system(&quot;foo.sh&quot;)</code>. <code>foo.sh</code> is located on <code>/one/dir</code> and contains command <code>bar.sh</code> that is in <code>/other/dir</code>. For a user using ssh connection and having <code>/one/dir</code> and <code>/other/dir</code> in PATH everything works.</p>
  <p>Now, if I put</p>
  <pre><code>&lt;Directory /var/www/mypage&gt;
  SetEnv PATH . . . :/one/dir:/other/dir
  </code></pre>
  <p>to Apache config, then <code>print getenv(&quot;PATH&quot;);</code> on <code>/var/www/mypage/mytest.php</code> shows that <code>/one/dir</code> and <code>/other/dir</code> are in the path. But <code>system()</code> still does not found <code>foo.sh</code>. What's wrong? And after this also <code>foo.sh</code> should see the same <code>PATH</code> so that it will find <code>bar.sh</code>.</p>
  <p>I am setting this on Ubuntu 20.04, PHP 7.4.3.</p>