Remotely executing a Shell script

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
Rahil
Forum Newbie
Posts: 17
Joined: Sun Feb 15, 2004 2:24 pm
Location: Toronto, Ontario, Canada

Remotely executing a Shell script

Post by Rahil »

I have two servers, one where my website is stored, and one where my shell scripts are stored.

How can a PHP page on my web server, exec a shell script on the other server? I can provide the username, password, and IP. All I need to do is exec a script. Both servers are Linux/UNIX by the way.

Thanks in advance.
TheBentinel.com
Forum Contributor
Posts: 282
Joined: Wed Mar 10, 2004 1:52 pm
Location: Columbus, Ohio

Post by TheBentinel.com »

I remember using the command: rcmd on a SCO Unix system. I don't know if it's specific to SCO or not. Worth checking out.

If not that, and you have a web server running on your shell script machine, you could run them through CGI.
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Very interesting topic. I havn't dealt with this myself, but for the thought of discussion...

What about cURL? It supports telnet so... it should in theory work (?).
Rahil
Forum Newbie
Posts: 17
Joined: Sun Feb 15, 2004 2:24 pm
Location: Toronto, Ontario, Canada

Post by Rahil »

I've never used cURL.

It seems like what I want to do is not possible through PHP :(
Zorth
Forum Commoner
Posts: 76
Joined: Fri Feb 20, 2004 8:00 pm

Post by Zorth »

Wrong thread...
Post Reply