title: How to save PDF file with mPDF and CodeIgniter
body: <p>I am using CodeIgniter 3 and mPDF to generate PDF files.
  In my controller I need to specify file path to store pdf files.</p>
  
  <p>At the moment this fragment of code works fine for me on my local server:</p>
  
  <pre><code>$pdfFilePath = FCPATH."/raports/invoice_".$data['nr'].".pdf";
  </code></pre>
  
  <p>however don't work on production (hosted server).
  As I bypass I've replaced <code>FCPATH</code> with <code>$_SERVER['DOCUMENT_ROOT']</code></p>
  
  <pre><code>$pdfFilePath = $_SERVER['DOCUMENT_ROOT']."raports/invoice_".$data['nr'].".pdf";
  </code></pre>
  
  <p>This solution works on production (but not on my local server), so every time I want to upload new version I need to change it.</p>
  
  <p><strong>Error message says:</strong></p>
  
  <pre><code>Message: fopen(): open_basedir restriction in effect. 
  fopen  failed to open stream: Operation not permitted
  </code></pre>
  
  <p>Any solution, which could work on both local and production server?</p>