Under PHP 8.0.13 all ok
Under PHP 8.1.0 I recived:
Warning: PHP Startup: ssh2: Unable to initialize module
Module compiled with module API=20200930
PHP compiled with module API=20210902
I was facing a very similar issue and found that make clean solved the problem.
(it seems the configure script does not invalidate already-compiled parts correctly when the module API has changed)
Under PHP 8.0.13 all ok Under PHP 8.1.0 I recived: Warning: PHP Startup: ssh2: Unable to initialize module Module compiled with module API=20200930 PHP compiled with module API=20210902