title: Running composer without using sudo
body: <p>I've followed the guide on installing composer globally from the composer site: <a href="https://getcomposer.org/doc/00-intro.md#globally" rel="noreferrer">https://getcomposer.org/doc/00-intro.md#globally</a></p>
  
  <p>The problem is I have to use sudo every time I use composer. This is a pain as every vendor folder that's created with <code>sudo composer update</code> is under the owner of <code>root</code> which I have to change to <code>www-data</code>.</p>
  
  <p><strong>Things I've tried:</strong></p>
  
  <p>I've tried using <code>chmod +x /usr/local/bin/composer</code> which still requires me to run composer with sudo as the file is owned by <code>root</code>.</p>
  
  <p>Changing owner of <code>/usr/local/bin/composer</code> to <code>www-data:www-data</code> with privileges set to 775. Still requires me to run composer with sudo prepended first.</p>
  
  <p><strong>How can I resolve this so I do not have to use <code>sudo</code> every time I run composer?</strong></p>