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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

746 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

12 Experts available now in Live!

Get 1:1 Help Now