If libssh2 is installed with Homebrew on macOS with Apple Silicone, installation of ssh2 fails with error:
configure: error: The required libssh2 library was not found. You can obtain that package from http://sourceforge.net/projects/libssh2/
ERROR: `/private/tmp/pear/temp/ssh2/configure --with-php-config=/opt/homebrew/opt/php/bin/php-config --with-ssh2' failed
I have to set libssh2 prefix to /opt/homebrew/opt/libssh2 manually. It would be nice, if autodetection will resolve the right path.