Jump to content

Execute program


starfleetrp

Recommended Posts

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.
Link to comment
Share on other sites

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?
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

[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.
Link to comment
Share on other sites

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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.