PHP COM Functions

Discussion about the open-source Phalanger [?] project.

PHP COM Functions

Postby Saeid.a » November 26th, 2013, 8:45 am

Hi,
I'm new to Phalanger and i'm trying to test all the functionalities that i need for my projects. But when i'm trying COM it says
Code: Select all
Call to undefined external function 'COM::com', extension 'php_com' (extension not found)
.
I've added bellow code to machine.config
Code: Select all
<add assembly="php_com.mng, Version=3.0.0.0, Culture=neutral, PublicKeyToken=4ef6ed87c53048a3" section="COM" />

and my code is :
Code: Select all
$obj = new COM ( 'winmgmts://localhost/root/CIMV2' );
     
$wmi_computersystem    =    $obj->ExecQuery("Select * from Win32_ComputerSystem");
Saeid.a
 
Posts: 1
Joined: November 26th, 2013, 8:26 am

Re: PHP COM Functions

Postby Jakub Misek » November 26th, 2013, 9:18 am

Hi,

I'm not sure, if the COM class is included in the bundled php_com.dll. Anyway since Phalanger provides .NET to PHP, it is recommended to use .NET/COM objects directly from PHP, e.g.:
Code: Select all
new System.Management.ManagementObjectSearcher("Select * from Win32_ComputerSystem")
and reference
Code: Select all
<add assembly='System.Management' />
Jakub Misek │ DEVSENSE s.r.o. │ Email: jakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2062
Joined: January 4th, 2012, 2:42 pm
Location: Prague


Return to Phalanger project

Who is online

Users browsing this forum: No registered users and 1 guest

cron

User Control Panel

Login

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 62 on January 7th, 2012, 10:54 pm

Users browsing this forum: No registered users and 1 guest
Phalanger