Answer the question
In order to leave comments, you need to log in
How to run bash script from php?
Hello. There was a situation that you need to run a bash script from php. Yes, not secure. This is driven by jalkit.
I do it like this:
$connection = ssh2_connect('ip', 29937);
if (ssh2_auth_password($connection, 'user', 'pass')) {
ssh2_exec($connection, 'bash /home/user/create_user ' + $name_user_server + ' ' + $pass_user_server);
} else {
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question