title: grant write permissions to user on a directory centos
body: <p>So I did this</p>
  
  <pre><code>sudo chown -R user1:user1 /var/www/example.com/public_html
  </code></pre>
  
  <p>and</p>
  
  <pre><code>sudo chmod 755 /var/www
  </code></pre>
  
  <p>but apparently when php wants to write a file on public_html folder
  I get an error saying " failed to open stream: Permission denied "</p>
  
  <p>Does anyone know what I'm doing wrong? </p>