Solved

COM object error on php script launch

Posted on 2009-05-17
9
875 Views
Last Modified: 2013-12-13
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.
0
Comment
Question by:artena
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
9 Comments
 
LVL 13

Expert Comment

by:kaylanreilor
ID: 24409133
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 ?
0
 

Author Comment

by:artena
ID: 24409191
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.
0
 
LVL 13

Expert Comment

by:kaylanreilor
ID: 24409225
So what could that mean ?
$WshShell = new COM("WScript.Shell");
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 

Author Comment

by:artena
ID: 24409232
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?
0
 
LVL 13

Expert Comment

by:kaylanreilor
ID: 24409251
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 ?
0
 
LVL 13

Expert Comment

by:kaylanreilor
ID: 24409255
And, BTW, are the settings of the Web Browser (perhaps IE) the same concerning ActiveX ?
0
 

Accepted Solution

by:
artena earned 0 total points
ID: 24416662
I don't know if there is because I -don't- know the specific name of the scripting shell COM object.  That's what I'm trying to determine, so I can verify if its there and if so what its settings are.  I'm using DCOM Config in Component Services to view the list.

As for the ActiveX settings its set to not download unsigned controls.  I'm using the same browser for both Apache and IIS.  The PHP is server side (called by a Flex client side) so it should be irrelevant.
0
 
LVL 13

Expert Comment

by:kaylanreilor
ID: 24420503
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.
0
 
LVL 13

Expert Comment

by:kaylanreilor
ID: 24902716
So what was the solution here ???
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question