title: How to load DLL file in PHP
body: <p>I am developing a custom application in PHP for Mdaemon Mail Server. There are no API samples in PHP, all are in CPP and VB. </p>
  
  <p>I know that we can work with dll in files in PHP using <a href="http://www.php.net/manual/en/book.com.php" rel="nofollow">COM</a> and I am also in windows environment. To get everything started I need to load <code>MDUser.dll</code> file. </p>
  
  <p>So far I have downloaded <code>php_com_dotnet.dll</code> and have placed it in extensions directory in my wamp server <code>C:\wamp\bin\php\php5.3.13\ext</code>. I have enabled the extension in php.ini <code>extension=php_com_dotnet.dll</code> </p>
  
  <p>This is my code</p>
  
  <pre><code>$oMDUser =  new COM("MDUserCOM.MDUser") or die("Unable to instantiate MDUSER COM object");
  </code></pre>
  
  <p>This line throws an error. </p>
  
  <blockquote>
    <p>Fatal error: Uncaught exception 'com_exception' with message 'Failed to create COM object <code>MDUserCOM.MDUser' in C:\wamp\www\mdaemon\test.php on line 20
    ( ! ) com_exception: Failed to create COM object</code>MDUserCOM.MDUser': Invalid syntax in C:\wamp\www\mdaemon\test.php on line 20</p>
  </blockquote>
  
  <p>Actually I don't know what MDUserCOM.MDUser refers to. How should I instantiate the COM class. Ex <code>$obj = new COM("Application.ID")</code> and what is application and ID in my scenario. </p>
  
  <p>I haven't worked with dll files before. Where I am going wrong and where should I place <code>MDUser.dll</code> file. Anyway it is in my working directory. </p>
  
  <p>Thanks in advance</p>