PHP can be used to access COM and DCOM objects on Win32 platforms.
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.
There are dozens of VARIANT types and combinations of them. Most of them are already supported but a few still have to be implemented. Arrays are not completely supported. Only single dimensional indexed only arrays can be passed between PHP and COM. If you find other types that aren't supported, please report them as a bug (if not already reported) and provide as much information as available.
Generally it is, but as PHP is mostly used as a web scripting language it runs in the web servers context, thus visual objects will never appear on the servers desktop. If you use PHP for application scripting e.g. in conjunction with PHP-GTK there is no limitation in accessing and manipulating visual objects through COM.
No, you can't. COM instances are treated as resources and therefore they are only available in a single script's context.
The COM extension throws com_exception
exceptions, which you can catch and then inspect the code
member to determine what to do next.
No, unfortunately there is no such tool available for PHP.
This error can have multiple reasons:
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
com.allow_dcom=
true
in your php.ini.
Edit your php.ini and set
com.allow_dcom=
true
.
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.
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:
<?php
$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.
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.
The answer is as simple as unsatisfying. We don't know exactly but we think you can do nothing.
COM+ extends COM by a framework for managing components through MTS and MSMQ but there is nothing special that PHP has to support to use such components.
PHP itself doesn't handle transactions yet. Thus if an error occurs no rollback is initiated. If you use components that support transactions you will have to implement the transaction management yourself.