title: PHP permission error on writing to a file in Linux CentOS
body: <p>I have installed linux centos 7 on a VmWare in Windows.</p>
  
  <p>There are two users in the linux: <code>root, sample</code></p>
  
  <p>I have created a laravel project with user "sample" (logged in as <code>sample</code>), but when I try to run the project with user root (logged in as <code>root</code>), it throws a permission error that cannot write to the file (<code>file_put_content()</code>). I have tried </p>
  
  <pre><code>chmod 777 /var/www/html/laravel
  </code></pre>
  
  <p>Or even I have tried to change the permission of the write-access of the file to root using right-click->properties->permission, but to no avail.</p>
  
  <p>The only possible solution has been to delete the file and re-create it with user root. Now, what is the solution? I though user <code>root</code> is privileged to do anything. But it seems it is not the case. What is the solution? How should change this issue? </p>