title: How to read a .docx file via PHP Word sample code in Codeigniter
body: <p>Am trying to read a .docx file which is inside my project folder via PHP Word library. I have included autoloader like this :
  <code>include_once  'vendor/autoload.php';</code>  in my controller.</p>
  <p><strong>CODE FOR FUNCTION IN CONTROLLER:</strong></p>
  <pre><code>function test_phpword()
  {
   $a=base_url();
   $path=$a.&quot;&quot;.'123.docx';
   $source =$path;
  
   echo date('H:i:s'), &quot; Reading contents from `{$source}`&quot;;
   $phpWord = \PhpOffice\PhpWord\IOFactory::load($source);
  
   echo write($phpWord, basename(__FILE__, '.php'), $writers);
  }
  </code></pre>
  <p><strong>BUT GETTING ERROR LIKE BELOW:</strong></p>
  <blockquote>
  <p>06:18:42 Reading contents from <code>http://localhost/myproject/123.docx</code></p>
  <p>Fatal error: Uncaught Exception: Cannot find archive file. in /opt/lampp/htdocs/myproject/vendor/phpoffice/common/src/Common/XMLReader.php:51</p>
  </blockquote>