Link to home
Start Free TrialLog in
Avatar of artena
artenaFlag for New Zealand

asked on

COM object error on php script launch

I'm attempting to launch a php script from within another php script using the following code:

$WshShell = new COM("WScript.Shell");
$oExec = $WshShell->Run($runCommand, 7, false);

where $runCommand is:
%comspec% /c "C:/wap_artena/wap/php/php.exe" -c C:/wap_artena/wap/php/php.ini C:\wap_artena\artena\private\server\services\ARTENA_Plus\Modules\External\DB/LRP_SDR.php 164 10.1.1.152

Apache generates no issue.  On IIS I receive the following error:

Source: Unknown
Description: Unknown

I have a feeling this is a permission-related issue but I'm not sure where or what to alter.

Thanks for your help.
Avatar of kaylanreilor
kaylanreilor
Flag of Luxembourg image

I suppose that you have 1 machine with Apache and another one with IIS, is that it ?
Probably their is no info reported by IIS because your script doesn't handle error cases.
Could it be that the COM is registered on the machine where Apache runs but not on the other ?
Avatar of artena

ASKER

The Apache and IIS environments are separate, yes.  It is possible that the COM object isn't registered on the IIS box but I'm not certain which COM object I'm looking for; there is no WScript.Shell object registered on the Apache box.
So what could that mean ?
$WshShell = new COM("WScript.Shell");
Avatar of artena

ASKER

I grasp that WScript.Shell is potentially the COM object but if so why would the script run fine on the Apache box, where it is not among the list of registered COM objects?
So you mean that there is no Windows scripting shell COM object on the machine ?!?
How do you know the name and what is the program you use view the list ?
And, BTW, are the settings of the Web Browser (perhaps IE) the same concerning ActiveX ?
ASKER CERTIFIED SOLUTION
Avatar of artena
artena
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What's going on is you open a command prompt and just type "CScript" ?
It should display the version and give you the oportunity to enable it.
So what was the solution here ???