Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

I wanted to run a specific command through ssh protocol on my server. And this is super helpful to do such kind of remote processing by PHP easily.

STEP 1. Installing SSH2 Extension

The first thing you need to check is if your system has SSH2 features or not. You can simply check at phpinfo() in php function. If not, you can simply install SSH2 functions by below commands in root permission. The below case is based on  Centos7.

...

That means you should do it in order to make it work like below

Code Block
# echo "extension=ssh2.so" > /etc/php.d/50-ssh2.ini


or


# echo "extension=ssh2.so" > /etc/php.ini


https://www.thelinuxfaq.com/253-how-to-install-ssh2-extension-for-php-rhel-centos-7