I have an interesting question. Is it possible to call a dll on the client machine from the server? I haven't found anything in my searches. I have been also wondering if I would have to write a custom extension for php to do this?

My main goal is to call a dll in the C:\Windows\System32 directory on the client. I have seen a Java application do what I want but I would have to buy a $800 security certificate so that the user could run the app on their machine. Maybe I need to look into a COM DLL or Webservice. Or even write a C/C++ app that connects to the server. I would like to know first if it can be done in PHP.

8 Years
Discussion Span
Last Post by nav33n

I am not sure. Maybe this could help.

Well is does sound promising to get what I'm after, but I'll have to check into COM and PHP a bit more.


Interesting Questions From:
I have built a DLL to calculate something. Is there any way to run this DLL under PHP ?

If this is a simple DLL there is no way yet to run it from PHP. If the DLL contains a COM server you may be able to access it if it implements the IDispatch interface.

How can I run COM object from remote server ?

Exactly like you run local objects. You only have to pass the IP of the remote machine as second parameter to the COM constructor.

Make sure that you have set Runtime Configuration=TRUE in your php.ini.

I get 'DCOM is disabled in C:\path...\scriptname.php on line 6', what can I do ?

Edit your php.ini and set Runtime Configuration=TRUE.

Is it possible to load/manipulate an ActiveX object in a page with PHP ?

This has nothing to do with PHP. ActiveX objects are loaded on client side if they are requested by the HTML document. There is no relation to the PHP script and therefore there is no direct server side interaction possible.

Is it possible to get a running instance of a component ?

This is possible with the help of monikers. If you want to get multiple references to the same word instance you can create that instance like shown:

               $word = new COM("C:\docs\word.doc");

This will create a new instance if there is no running instance available or it will return a handle to the running instance, if available.

Is there a way to handle an event sent from COM object ?

You can define an event sink and bind it using com_event_sink(). You can use com_print_typeinfo() to have PHP generate a skeleton for the event sink class.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.