starfleetrp Posted December 18, 2006 Share Posted December 18, 2006 I am trying to run a Win32 exe (not a console) with PHP, and it was designed to stay up and running. I have tried to use exec(program.exe) but that does not work, and I am not sure what other options I have left? This program will be a game server that I want to launch externally, if for some reason it crashed via my website. Quote Link to comment https://forums.phpfreaks.com/topic/31166-execute-program/ Share on other sites More sharing options...
trq Posted December 18, 2006 Share Posted December 18, 2006 When you say that it doesn't work have you checked your running process list. Any program run via php will not open on the desktop. Quote Link to comment https://forums.phpfreaks.com/topic/31166-execute-program/#findComment-144012 Share on other sites More sharing options...
Daniel0 Posted December 18, 2006 Share Posted December 18, 2006 I think the program will terminate when the script ends. Quote Link to comment https://forums.phpfreaks.com/topic/31166-execute-program/#findComment-144013 Share on other sites More sharing options...
starfleetrp Posted December 18, 2006 Author Share Posted December 18, 2006 No, it is not running in the processes. Well actually this program is a log monitor for the game server that it launches when it is ran. It was programmed in C#. When I open the page it never stops loading (it is trying to run it) however like I said there was no process opened. Is there a way I could send a dos command to run my program, since that should still work? Quote Link to comment https://forums.phpfreaks.com/topic/31166-execute-program/#findComment-144030 Share on other sites More sharing options...
trq Posted December 18, 2006 Share Posted December 18, 2006 Yeah actually, as Daniel0 stated the program will terminate when the script ends. Makes more sense. The only way I think you could do this would be to fork another process but that isn't avaiable AFAIK in the windows implimentations of php.You could maybe write a batch program which could do the forking, but this then becomes a batch script question and not a php one. Quote Link to comment https://forums.phpfreaks.com/topic/31166-execute-program/#findComment-144037 Share on other sites More sharing options...
Daniel0 Posted December 18, 2006 Share Posted December 18, 2006 Wouldn't the batch script then end causing the problem still to end?I don't think what you try to do is possible if you do not want it open all the time. Why not use VNC or another remote desktop solution instead? Quote Link to comment https://forums.phpfreaks.com/topic/31166-execute-program/#findComment-144043 Share on other sites More sharing options...
Snooble Posted December 19, 2006 Share Posted December 19, 2006 If you did use a batch file,No.1-> you'll have a lot of dangerous alerts to deal with. E.g. Firewalls, Anti-Virus'. As they are incredibly flexible.No.2-> The program shouldn't close on script end using .bat's. As long as the program being launched is stable alone.Possibly you should look at sub launching the exe on launch of the game server. Bare in mind this information is coming from someone who used to play CS 1.5 a LONG time back. Quote Link to comment https://forums.phpfreaks.com/topic/31166-execute-program/#findComment-144071 Share on other sites More sharing options...
trq Posted December 19, 2006 Share Posted December 19, 2006 [quote]Wouldn't the batch script then end causing the problem still to end?[/quote]Not if you can somehow spawn another process from within the batch script. Im used to running Linux where this kind of thing is simple, windows though, im not too sure about. Quote Link to comment https://forums.phpfreaks.com/topic/31166-execute-program/#findComment-144077 Share on other sites More sharing options...
Snooble Posted December 19, 2006 Share Posted December 19, 2006 would the use of "pause" divert this tradegy? Or am i too simple... Apologise if we're in a completely different mind frame here. Quote Link to comment https://forums.phpfreaks.com/topic/31166-execute-program/#findComment-144078 Share on other sites More sharing options...
trq Posted December 19, 2006 Share Posted December 19, 2006 Well, for starters, there is no such thing as pause. I think you mean sleep, and no, that will not help. Quote Link to comment https://forums.phpfreaks.com/topic/31166-execute-program/#findComment-144081 Share on other sites More sharing options...
starfleetrp Posted December 19, 2006 Author Share Posted December 19, 2006 Ok, Well I tried to make another program create a new process, but that did not work since the processes it created were also hidden. Any other ideas? Quote Link to comment https://forums.phpfreaks.com/topic/31166-execute-program/#findComment-144099 Share on other sites More sharing options...
Snooble Posted December 19, 2006 Share Posted December 19, 2006 there is a command - "pause" in a batch file. Sorry if you misunderstood. Also sunshine, could you throw me a bone on my subject as i've updated it with a well descriptive post of what i want and what's going wrong. Would be much appreciated :) Snooble Quote Link to comment https://forums.phpfreaks.com/topic/31166-execute-program/#findComment-144116 Share on other sites More sharing options...
trq Posted December 19, 2006 Share Posted December 19, 2006 Who the heck is sunshine? Quote Link to comment https://forums.phpfreaks.com/topic/31166-execute-program/#findComment-144233 Share on other sites More sharing options...
Snooble Posted December 19, 2006 Share Posted December 19, 2006 referring to you. But it's cool now. My topic was solved, no problems with the php code apart from it being messy. It must've been the server. Tip: Don't use www.ifastnet.com for php hosting. They must have some higher set restrictions. Sunshine is a pro-noun in the slang world. can be interchanged with 'you'. Or you can just ignore it, like you did :).Thanks for your help. starfleetrp are you still looking for a solution? Snooble Quote Link to comment https://forums.phpfreaks.com/topic/31166-execute-program/#findComment-144352 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.