title: Different output of exec() command when executed in browser vs. terminal
body: <p>It's very weird that when executed in terminal, it does fine but not when triggered via browser. The python script executed via exec is just pushing jobs to RMQ and returns the documents/keys(jobs) pushed.
  Browser doesn't show those keys pushed while in terminal it is shown. Please see the output arrays below:</p>
  
  <p>When executed via browser:</p>
  
  <pre><code>(
      [0] =&gt; &gt; -rerun
      [1] =&gt; &gt; -status
      [2] =&gt; &gt; -companies
      [3] =&gt; &gt; -websites
      [4] =&gt; &gt; -searchstring
      [5] =&gt; &gt; -queue
      [6] =&gt; &gt; -followrule
      [7] =&gt; {'command args'}
  )
  </code></pre>
  
  <p>But when executed via terminal:</p>
  
  <pre><code>(
      [0] =&gt; &gt; -rerun
      [1] =&gt; &gt; -status
      [2] =&gt; &gt; -companies
      [3] =&gt; &gt; -websites
      [4] =&gt; &gt; -searchstring
      [5] =&gt; &gt; -queue
      [6] =&gt; &gt; -followrule
      [7] =&gt; {'command args'}
      [8] =&gt; Çompany Keys: 4
      [9] =&gt; Websites Keys: 4
      [10] =&gt; Search Keys: 4
      [11] =&gt; Total No. Of Jobs: 1
      [12] =&gt; [x] Sent:_id 'doc_id'
      [13] =&gt; Rerun: ranks - 1
  )
  </code></pre>
  
  <p>On the terminal, the job was pushed to RMQ but not when triggered via browser.</p>
  
  <p>Edit: Added code</p>
  
  <pre><code>&lt;?php
     $command = "sudo -u ronald /opt/env3/bin/python3 script.py";
     exec($command,$output,$return);
  
     echo "&lt;pre&gt;";
       print_r($output);
     echo "&lt;/pre&gt;";
  ?&gt;  
  </code></pre>