I have a project that needs to access a DLL with PHP. The server is a Windows machine and the Apache server is provided by XAMPP.
I read multiple answers on the web like
- Use DLL in PHP?
- php communication with dll?
- calling dll through php
- http://ca.php.net/manual/en/class.com.php
- https://www.php.net/manual/en/book.w32api.php
- http://www.talkphp.com/absolute-beginners/3340-php-how-load-com-dll-file.html
Here is how I call the DLL in HTA / Javascript:
<object style="display:none" id="SOME_ID" classid="clsid:SOME_CLASS_ID" codebase="./somePath.dll"></object>
Does someone have a working example?
Here is what I tried so far in PHP:
$obj = new COM('pathTo.dll');
Information on the DLL:
- Compiled using Delphi
- It is (of course) home made
- I get the following error
the DllRegister Server entry point was not foundwhen I try to register the DLL withregsvr32
Can it be used without registering it with regsvr32?
When you create your DLL file, you need to use a module definition file. It will contain something similar to this:
That definition allows regsvr32 to find the DllRegisterServer entry point.
Another option you can try is to pass the /n flag to regsvr32.
Ultimately, before you try to make a DLL work with PHP, you need to be sure your DLL works in general.