exec? system?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
RedFive
Forum Newbie
Posts: 4
Joined: Thu Apr 10, 2003 7:18 pm

exec? system?

Post by RedFive »

Hi,

I'm running a game server on XP and (unfortunately) it only runs in gui. So I tried, as a test, to exec notepad.exe but it just runs it in the background (lot of good that does!). I was wondering if there was anyway to get it to run in the foreground?
bionicdonkey
Forum Contributor
Posts: 132
Joined: Fri Jan 31, 2003 2:28 am
Location: Sydney, Australia
Contact:

Post by bionicdonkey »

system() should work
RedFive
Forum Newbie
Posts: 4
Joined: Thu Apr 10, 2003 7:18 pm

Post by RedFive »

It doesn't...

So far I can only get it to run in the background. I want to be able to see it on the server...not possible? :?:
User avatar
daven
Forum Contributor
Posts: 332
Joined: Tue Dec 17, 2002 1:29 pm
Location: Gaithersburg, MD
Contact:

Post by daven »

check out passthru(). It should do what you want (execute a command and pass all output to the browser)
RedFive
Forum Newbie
Posts: 4
Joined: Thu Apr 10, 2003 7:18 pm

Post by RedFive »

Mmmm, actually...I guess I should better explain it...

I have a game server running that only runs with the Windows GUI. I want to be able to start and stop it remotely via php...yet when I physically use the server, I still want to see it running in the foreground. Currently, I can only get php to run it in the background -- which means there's no way to access it when you're physically at the server computer. Does that make sense? I hope so :cry:
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post by Stoker »

I don't know XP, for William NT and 2000 there is a SRVANY tool in the resourcekit, install the gameserver as a service, then use your phpscript to use system('net start servicename'); or something like that..
RedFive
Forum Newbie
Posts: 4
Joined: Thu Apr 10, 2003 7:18 pm

Post by RedFive »

Woooohooo! It works!!

Thanks Stoker :o
Post Reply