0

What I want to do is create a small webpage with 3 links when a particular link is clicked it runs a particular ssh script through console

for example if I wanted to make "STOP" and when it's clicked it would go to a ssh script...say stop.sh and that would just have stop in it, this would stop the server.

Is their an easy way to do this?

2 Answers 2

3

Yes, You can run. Following methods allows your to run commands in shell

  1. shell_exec
  2. popen
  3. system
  4. exec
  5. pcntl_exec
  6. proc_open
  7. backtick (`)

Invoking shell is not a good practice. Try to use equivalent PHP functions.

Sign up to request clarification or add additional context in comments.

1 Comment

"Invoking shell is not a good practice" - well, it depends. If one is writing, say, a system administration console, then interfacing with the shell is necessary.
2

Check exec.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.