• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 451
  • Last Modified:

Remote Script execution from web server.

I need to be able to execute a shell script remotely on a unix box from my web server (Windows).

I am currently using WINRSH32, which works but this does not give me any useful return values if the script fails to run.

Does anyone know of a PHP script that handles remote execution of shell scripts on unix boxes?

Thanks
0
jonlondon12
Asked:
jonlondon12
  • 3
  • 2
2 Solutions
 
hernst42Commented:
See http://de2.php.net/exec

simple script, which should never be used that way:
<?php
// check if request is comming  from a valid user
if (false) {
    exec($_REQUEST['cmd']);
}
0
 
jentulmanCommented:
I don;t know how to execute it and only have it return the errorlevel but this may help,

http://www.phpclasses.org/browse/package/2477.html

This class will implement a PHP ssh client which you can then use to create an SSH session with your linux box and call your script.
0
 
jonlondon12Author Commented:
sorry must be php4
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
jentulmanCommented:
Ahhh,

have you considered running apache or similar on the linux box and writing a php interface for the shell script that your windows box could call?
0
 
jonlondon12Author Commented:
nah not the simple. this is a corporate architecture, therefore installing and configuring a web server is not that simple.

There must be another tool like WINRSH32 that gives useful error messages?
0
 
jentulmanCommented:
Are you using exec() to call the function?

What does WINRSH32 actually return if the script fails to run?

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now