简体   繁体   中英

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?

Best Regards Thayalan

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM