title: Compile error: "g++: error trying to exec 'cc1plus': execvp: No such file or directory"
body: <p>When I compile C/C++ program with <code>popen</code> in <code>php</code>... I got this error:</p>
  
  <pre><code>g++: error trying to exec 'cc1plus': execvp: No such file or directory
  </code></pre>
  
  <p>but if I run php code in shell.. it works fine..</p>
  
  <p>in Arch Linux..</p>
  
  <p>PHP Code:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
      function rfile($fp) {
      $out="";
         while (!feof($fp)) {
             $out.= fgets($fp, 1024000);
         }
         return $out;
      }
      $p = popen('g++ -Wall -g aplusb.cc -o aplusb 2&gt;&amp;1', 'r');
      $result = rfile($p);
      pclose($p);
      echo $result;
  ?&gt;
  </code></pre>
  
  <p>thanks</p>