title: Class 'COM' not found
body: <p>I've been trying to open a word document in my script, but I get receiving the same error.</p>
  
  <pre><code> Fatal error: Class 'COM' not found in /Applications/XAMPP/xamppfiles/htdocs/**/**.php on line 3
  </code></pre>
  
  <p>My code: </p>
  
  <pre><code>&lt;?php
  
  $word = new COM("word.application") or die("Unable to instantiate Word"); 
  
  $word-&gt;Visible = 1; 
  
  
  $word-&gt;Documents-&gt;Open("wordfile.docx");
  $temp = $word-&gt;Dialogs-&gt;Item(228); // returns wdDialogToolsWordCount dialog object
  $temp-&gt;Execute();   //updates the word count
  $numwords = $temp-&gt;Words(); //gets the words out of it
  
  echo 'Word count = '.$numwords;
  
  $word-&gt;Quit(); 
  
  ?&gt;
  </code></pre>
  
  <p>I've tried to change <code>php.ini</code> and remove the semicolons from <code>COM</code> section. </p>
  
  <pre><code>[com]
  path to a file containing GUIDs, IIDs or filenames of files with TypeLibs
  com.typelib_file = 
  allow Distributed-COM calls
  com.allow_dcom = true
  autoregister constants of a components typlib on com_load()
  com.autoregister_typelib = true
  register constants casesensitive
  com.autoregister_casesensitive = false
  show warnings on duplicate constat registrations
  com.autoregister_verbose = true 
  </code></pre>
  
  <p>and still getting the same error. </p>
  
  <p>I'm using a <code>XAMMP</code> on mac, and a linux based web hosting.</p>