Remote Script execution from web server.

Posted on 2007-08-03
Last Modified: 2013-12-13
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?

Question by:jonlondon12
    LVL 48

    Accepted Solution


    simple script, which should never be used that way:
    // check if request is comming  from a valid user
    if (false) {
    LVL 4

    Expert Comment

    I don;t know how to execute it and only have it return the errorlevel but this may help,

    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.

    Author Comment

    sorry must be php4
    LVL 4

    Expert Comment


    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?

    Author Comment

    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?
    LVL 4

    Assisted Solution

    Are you using exec() to call the function?

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


    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Change local server setting in php 6 32
    Bing Maps 1 23
    Where is the title coming from 6 34
    simple if statement 3 12
    Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
    Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now