shutting stuff off through php

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
Shaggy
Forum Newbie
Posts: 7
Joined: Wed Apr 11, 2007 9:01 pm

shutting stuff off through php

Post by Shaggy »

I'm wondering if this is possible.
I have a program running on (lets say) computer1 with a process called woopie.exe and its connected through port 1234
My other computer is called computer2 and it runs my apache2.2 server along with php 5.x
Also my router is running DD-WRT v24 SP1

so im usually not home and im wondering if it is possible to create a php site that will enable to pop on any computer in the world and go to a specific php page that i created and hosted off my server at home that will check if on computer1 woopie.exe is either running or streaming data through that port and if it is if theres a way to either shut it off or cut the connection by running a script on my router?

is this possible?
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: shutting stuff off through php

Post by alex.barylski »

It is possible, yes.

The computer running LAMP and your PHP web site would need to be accessible to the outside world, so your router would obviously need to have port 80 opened up, so make sure you button down the hatches, considering what you want to do. :P

Anyway, the other computers would need SSH servers running, so the PHP script would simply connect to the server computers, execute PS command and KILL and voila, it's that easy. :)

Cheers,
Alex
Shaggy
Forum Newbie
Posts: 7
Joined: Wed Apr 11, 2007 9:01 pm

Re: shutting stuff off through php

Post by Shaggy »

ok so i would install an SSH server on computer1 and just run a kill command on the PHP?
and yep i have everything accessible from the outside so were all good on that :)
also im still very noob with php in general...
thanks for the info i will be cheking it out as soon as i can... im in the process of messing around with multiple computers to work as servers so ill get back to you once i get it done
Post Reply