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
461 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Advice on Xojo as a development tool over VB. 4 39
Method for submitting dynamically created rows 20 17
Checking if varaible is empty 6 31
Not seen Link button 5 15
Learn about cloud computing and its benefits for small business owners.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
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 create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

895 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now