php's ssh2 extension installation on RHEL8 with php 7.4

I have installed php7.4 via RHEL8's Default Stream using dnf. I want to install the php's ssh2 module.

How do I install Pyrus (Pear2 Package Manager) on RHEL8 with php7.4?

When I tried: php pyrus.phar I got the error message in command prompt: Could not open input file: pyrus.phar

I used:

updatedb 
locate pyrus

Got nothing

So, what is the issue here?

Upvotes: 0

Views: 2373

Answers (2)

Michael Mueller
Michael Mueller

Reputation: 1

In my first attempt when running ./compile on redhat 8 and PHP 7.2
i got the following errors :

configure: ERROR: No openssl crypto library found!  
No libgcrypt crypto library found!  
No mbedtls crypto library found!  
No wincng crypto library found!  

After installing mbedtls + openssl-devel it worked !

Upvotes: 0

I wanted to install php's ssh2 extension via Pyrus but I was having trouble with Pyrus. Therefore, I tried it without Pyrus. I preferred yum or dnf installation throughout. But, it was not possible for some. The following are how I have installed ssh2:

yum install make gcc php-devel php-pear

libssh2 package (ssh2 package needs it) installed by downloading the file https://libssh2.org/download/libssh2-1.10.0.tar.gz into an appropriate folder. Then, I entered the following commands:

tar -zxvf libssh2-1.10.0.tar.gz
cd libssh2-1.10.0
./configure
make
make install

ssh2 package installed by downloading the file https://pecl.php.net/get/ssh2-1.3.1.tgz into an appropriate folder. Then, I entered the following commands:

tar -zxvf ssh2-1.3.1.tgz
cd ssh2-1.3.1
phpize
./configure
make
make test
make install

Then I entered the following entry into /etc/php.ini: extension=ssh2.so

After that, I restarted php by: systemctl restart php-fpm

And now, php's ssh2 extension has been successfully installed.

Upvotes: 2

Related Questions