title: pbcopy via shell_exec() not working with native PHP installed in MAC Sierra by default
body: <p>I want to copy some text sent by browser to clipboard after making changes using PHP and I can do that with PHP installed via AMPPS or XAMPP but when I try it with PHP which comes by default on Sierra I'm neither getting any error message nor the text is getting copied to clipboard.</p>
  
  <p>This is the code I'm using</p>
  
  <pre><code>shell_exec("echo 'Any random text' | tr -d '\n' | pbcopy");
  </code></pre>
  
  <p>I tried changing permissions of PHP file, ensured that code works in terminal. I tried giving absolute paths like </p>
  
  <pre><code>shell_exec("/bin/echo '$text ' | tr -d '\n' | /usr/bin/pbcopy");
  </code></pre>
  
  <p>I ensured safe mode is not enabled because I get output "_www" for this code</p>
  
  <pre><code>echo shell_exec("whoami");
  </code></pre>
  
  <p>Still I cannot copy the text. Out of limitations I have to use only default PHP in sierra. Can anyone please help me with this issue.</p>