Executing shell commands using PHP, e.g. shell_exec() etc., on a remote host?

If you mean "a remote computer" as in "not the client computer", the answer is an unqualified yes; commands run via PHP's exec function will execute on the web server If you mean "not the web server", the answer is a slighty-hazier yes. You can only directly execute commands on the server running PHP. However, those commands can then run others on remote machines via mechanisms such as SSH.So, for example, if your web server has passwordless ssh access to the remote machine (a very bad idea), this would work: exec('ssh otherhost someremotecommand') What solution fits for you depends on your desired usage.

If you mean "a remote computer" as in "not the client computer", the answer is an unqualified yes; commands run via PHP's exec function will execute on the web server. If you mean "not the web server", the answer is a slighty-hazier yes. You can only directly execute commands on the server running PHP.

However, those commands can then run others on remote machines via mechanisms such as SSH. So, for example, if your web server has passwordless ssh access to the remote machine (a very bad idea), this would work: exec('ssh otherhost someremotecommand');. What solution fits for you depends on your desired usage.

Yes, and there is no need to change any code to do so. However, if your server puts PHP into safe mode (the lesser shared hosting plans often do) you may not be able to do this. Tip: You can use this shorthand to get the output of a command: $output = `command here`.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions