#38719 [Com]: COM Error during accessing function VirtualMachines

From: Date: Mon, 11 Dec 2006 18:56:26 +0000
Subject: #38719 [Com]: COM Error during accessing function VirtualMachines
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-106213@lists.php.net to get a copy of this message
ID: 38719 Comment by: ana dot laura123 at gmail dot com Reported By: techscorpio at lxlabs dot com Status: Assigned Bug Type: COM related Operating System: Windows 2003 r2 PHP Version: 5.1.6 Assigned To: wez New Comment: I have the same error. I'm trying to start a new php process to run a php script in the background. This is what i'm doing: $WshShell = new COM("WScript.Shell"); $oExec = $WshShell->Run('C:\php\php.exe startEngine.php'); the script runs ok when i start it from a command window. but it gives me this error when i try to run it from a php page: Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> Unknown<br/><b>Description:</b> Unknown' in c:\Inetpub\wwwroot\M3PHP\Engine\EngineService.php:60 Stack trace: #0 c:\Inetpub\wwwroot\M3PHP\Engine\EngineService.php(60): com->Run('C:\php\php.exe ...') #1 {main} thrown in c:\Inetpub\wwwroot\M3PHP\Engine\EngineService.php on line 60 PHP Fatal error: Uncaught exception 'com_exception' with message 'Source: Unknown Description: Unknown' in c:\Inetpub\wwwroot\M3PHP\Engine\EngineService.php:60 Stack trace: #0 c:\Inetpub\wwwroot\M3PHP\Engine\EngineService.php(60): com->Run('C:\php\php.exe ...') #1 {main} thrown in c:\Inetpub\wwwroot\M3PHP\Engine\EngineService.php on line 60 Previous Comments: ------------------------------------------------------------------------ [2006-09-05 06:50:58] techscorpio at lxlabs dot com Description: ------------ Hi, i am trying to warite a php script for administration of microsoft virtual server when i use a COM "VirtualServer.Application" the object is created but when i tried to access "VirtualMachines" etc,the COM function will troughs error. Reproduce code: --------------- Hi, I tried many times but still it's troughing the same error, i tried some other example but it seems actual problem is in php, it will not accessing COM properly i tried like this vb script:- 'Script Begins On Error Resume Next 'Connect to Virtual Server Set virtualServer = CreateObject("VirtualServer.Application") 'Get collection of virtual machines set vmCollection = virtualServer.VirtualMachines 'Iterate over the virtual machines and display data For Each vm in vmCollection Wscript.Echo "==============================" Wscript.Echo "Name: " & vm.Name Wscript.Echo Wscript.Echo "Notes: " & vm.Notes Wscript.Echo "==============================" Next 'Script Ends Works Fine PHP Script <?php f1(); function f1() { //Connect to Virtual Server $virtualServer = new COM("VirtualServer.Application"); //Get collection of virtual machines $vmCollection = $virtualServer->VirtualMachines; //Iterate over the virtual machines and display data foreach( $vmCollection as $vm) { print("\n=============================="); print( "\nName: " $vm->Name); print("\n=============================="); } } Throughs Run time ERROR: Fatal error: Uncaught exception 'com_exception' with message 'Source: Unknown Description: Unknown' in C:\Program Files\lxlabs\ext\php\test.php:9 Stack trace: #0 C:\Program Files\lxlabs\ext\php\test.php(9): f1() #1 C:\Program Files\lxlabs\ext\php\test.php(2): f1() #2 {main} thrown in C:\Program Files\lxlabs\ext\php\test.php on line 9 When i cought Exception it will tough Object #2 please help me it's urgent Expected result: ---------------- it will show all the virtual machines under virtual server Actual result: -------------- Fatal error: Uncaught exception 'com_exception' with message 'Source: Unknown Description: Unknown' in C:\Program Files\lxlabs\ext\php\test.php:9 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38719&edit=1

« previous php.bugs (#106213) next »