Ask Your Question

How to install php's ssh2 extension on RHEL8 running php 7.4?

asked 2022-05-05 11:00:00 +0000

huitzilopochtli gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2023-03-19 06:00:00 +0000

devzero gravatar image

To install the php ssh2 extension on RHEL8 running php 7.4, follow the steps below:

  1. Install the dependencies required for compiling the ssh2 extension:

    sudo dnf -y install gcc php-devel php-pear libssh2-devel
  2. Install the ssh2 extension via the pecl command:

    sudo pecl install ssh2-1.3.1
  3. Once the ssh2 extension is installed successfully, add the extension to the php.ini file:

    sudo echo "" >> /etc/php.ini
  4. Verify that the ssh2 extension is loaded by running the following command:

    php -m | grep ssh2

    If the extension is correctly loaded, it will output "ssh2". If you encounter any issues, restart your web server:

    sudo systemctl restart httpd

And that's it! You have successfully installed the php ssh2 extension on RHEL8.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer

Question Tools


Asked: 2022-05-05 11:00:00 +0000

Seen: 17 times

Last updated: Mar 19 '23