I've seen many posts on stackoverflow but none of them helped.
I was (am) trying to run a .NET Windows Forms application (it doesn't contain any forms/GUI/dialogs/so
but because of the nature of app it has to be Windows Forms). I tried shell_exec()
, exec()
, passthru()
, etc. but all of them failed (they take infinitely long time and PHP Script never terminates)
Then, I tried running a simple C++ (unmanaged) console application - it WORKED and returned correct output and return code.
Then, I thought, maybe I could call this C++ EXE and let it further call a Windows application (i.e. in C++ using SYSTEM("path_to_exe.exe");
)
It worked fine when I compiled it, but again,
when PHP calls this console (with new code to run a .NET EXE), PHP again takes infinte time and never stops. Why?
Is there any one way I can successfully run my .NET EXE on Server from PHP?
Thanks a lot!