title: CodeIgniter - Message: mkdir(): Permission denied on Ubuntu
body: <p>I'd like some help please. I have this PHP script inside my Post_model constructor</p>
  
  <pre><code>$dir = FCPATH . 'uploads' . DIRECTORY_SEPARATOR . 'posts'; 
  if (!is_dir($dir)) {
      mkdir($dir, 0755, true);
  } 
  </code></pre>
  
  <p>which shows me this error:</p>
  
  <pre><code>Severity: Warning
  
  Message: mkdir(): Permission denied
  </code></pre>
  
  <p>The main idea is that the project has the ability to create users and these users can upload images, or create folders-albums which are stored in the uploads folder.</p>
  
  <p>I've been struggling to fix this error the last days and can't find a solution. I have tried this code and on Windows and works great, but not on Linux (Ubuntu 14.04)</p>