title: mPDF error: Unable to create output file
body: <p>I am Using <a href="http://mpdf1.com/mpdf/" rel="nofollow noreferrer">mPDF</a> to generate pdf from an html.</p>
  
  <p>On my localhost the pdf is generated to the located directory successfully.
  But not on Server, although I have open the permissions of that directory.</p>
  
  <pre><code>chmod -R 0777 /mydirectory
  </code></pre>
  
  <p>Found  <a href="https://stackoverflow.com/questions/18515162/fpdf-error-unable-to-create-output-file#comment27250480_18527894">this comment</a> from an answer and changed <code>fopen($file_out,'wb');</code> to <code>fopen($file_out,'w+');</code> in mpdf.php</p>
  
  <p>But no success.</p>
  
  <p>Thanks for any help.</p>