Installing ssh2 extension on CentOS with nginx + php-fpm

Easy task if you have an apache server, but what about nginx + php-fpm?

Spent like 40 minutes to figure this out with 20+ tabs opened in Chrome… I have pure nginx + php-fpm install on CentOS, but most tutorials is about how to install ssh2 extension for php, not php-fpm. So the right answer is:

Hope that helps.


Rate this post

Comments (4)

  1. Honestly, I think you’d be better off with phpseclib, a pure PHP SSH2 implementation. eg.

    It has a number of advantages over php-pecl-ssh2 as discussed here:

    • Agree, but what if you already have a project which working with ssh2 and you don’t have a time/resource/will to rewrite it? This post is for those cases.

  2. I’m curious a bit, what is the purpose to use ssh from php. Can’t imagine useful scenario for this feature

What do you think?

Required fields are marked *