?
Solved

Using PHP to start a .NET EXE - My .EXE Hangs when I try to pop a GUI item!

Posted on 2008-10-23
1
Medium Priority
?
468 Views
Last Modified: 2012-06-27
I've now spent over 3 hours trying to invoke an EXE file from my PHP code.

******** My Setup *********************************
Dedicated Server running windows server 2003 (IIS 6)

******** What I need to do *********************************
What I need to do: I need to use a command that executes a VB.NET program (with a GUI) that should run and eventually terminate thus passing control back to the PHP Script.

Here's the problem. I can run a console-based VB.NET program just fine, but the moment I try to pop a MsgBox() or something, the program just hangs... for eternity.

I do understand that, since the EXE is being invoked by a PHP script, the EXE is being run under the IUSR account.

I believe that IUSR is able to do some simple things (such as write to console or write to file) but not more complex things that require certain DLLs (MessageBoxes, Internet Queries).

THE QUESTION: Is there some way for me to Invoke a GUI .NET application from php script?


My General Thoughts:
- There must be some way to register all of the appropriate DLLs with the IUSR account.
- Or, if I could get the application to run under a different user with more permissions, I'd be a happy camper.
- I dont really need the GUI to appear - but i included that in the question because I have some functionality such as querying URLs that will require .NET dlls
- I've heard rumor that ASP is better at running .NET exe's, but I don't know if the EXE's will run at their "full potential"
- I really dont want to have to change to a damn scripting language for the task that this EXE performs
- I'm also sure had I not tried to "pop a message box" that the EXE would hang anyway the moment it tries to display its main form

Thanks in advance for your help





0
Comment
Question by:hamlin11
[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
1 Comment
 

Accepted Solution

by:
hamlin11 earned 0 total points
ID: 22817976
The answer is to A) make sure you are aware of the programs actual working directory as far as the operating system is concerned (you may be surprised) and B) make sure that read/execute/write permissions are on the appropriate files/folders and C) do not try any GUI elements at all.


0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
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.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

800 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