For some reason I can’t seem to get exec, passthru or system to run a specific command. It will run trivial commands such as “ls -l” but it will not run
I’ve edited the command to not contain the actual domain or password of course. This command works correctly when run from PuTTY but it doesn’t seem to do anything at all when run from a PHP script. Nor does it cause any kind of errors. I even went through the trouble of ensuring that errors were being correctly logged in /var/logs/php_errors.log and the above three php commands don’t trigger an error.
I don’t believe you can actually execute such a command like SSH directly, I think what you want to use it the PECL SSH extension that allows you to open and executes commands on remote servers.
You can decide for yourself whether to allow those commands if you have VPS or dedicated hosting. On shared hosting it is up to the provider whether they allow it or not and whether they allow it automatically or only if you provide them with a good reason for needing it.