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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

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 …
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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…

838 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