Is it possible to execute shell commands on a remote computer (not localhost)? For instance things like
$output = shell_exec("unzip filename.zip");
You can assume that you have the login credentials of a user account on the remote machine, as well as the remote root username, password, and cpanel remote access key.
If you mean “a remote computer” as in “not the client computer”, the answer is an unqualified yes; commands run via PHP’s
execfunction 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.