How to install "ssh2" php extension

Hello everyone, i am trying to run my old source code (from httpd webserver), i have a problem, 1 module - “php-ssh2” didn’t installed. I had try to install by manual way:
install libssh2
install ssh2 from pecl and got in /usr/lib64/php/modules
then i copy it to /usr/local/lsws/lsphp72/lib64/php/modules/ and add to files /usr/local/lsws/lsphp72/etc/php.ini this line
“ssh2_extension = /usr/local/lsws/lsphp72/lib64/php/modules/”
but i doesn’t work, can anyone help me ?

Bump. Trying this myself and it’s not showing up in my phpinfo. @CyberPanel, any advice on this one?

Found the answer! Here’s the trick. If you look at the official package for ssh2 for PHP, the extension is supposed to be loaded after other specific PHP extensions and before other ones. If you download the package here and extract it…

… that means you should add the file “40-ssh2.ini” to your folder “/usr/local/lsws/lsphp74/etc/php.d/” with the following contents:

; Enable ssh2 extension module

So, to answer this, no, you cannot simply add “ssh2_extension = /usr/local/lsws/lsphp72/lib64/php/modules/” to php.ini since it has to be loaded in a very particular order. By adding the following file above to your php.d folder, then the ssh2 extension, from being in the proper order, will load successfully. Hope this helps!

I can’t find the 40-ssh2.ini files