Does anyone know how to install the PHP extension "php-ssh2" on an Azure App Service with PHP version 8.2 and Linux OS?
I tried installing the extension from a different repository, but unfortunately this does not work ([Not candidate version]).
Thank you in advance,
Check the below steps to install the SSH2
extension in Azure Linux App Service
.
Open the KUDU
Console:
https://YourApp.scm.azurewebsites.net/webssh/host
My PHP Version:
apt-get update
apt-get install -y libssh2-1-dev
pear config-show
command to see the paths of the directories.Run
pecl install https://pecl.php.net/get/ssh2-1.4.tgz
command to install the ssh2 zip file.
You can see the downloaded ssh2
file in /tmp/pear/download
directory
Next run the below commands
cd /tmp/pear/download/
tar -xzf ssh2-1.4.tgz
cd ssh2-1.4
phpize
./configure
make
make install
Now you can see modules folder is created in /tmp/pear/download/ssh2-1.4
directory.
modules folder contains the ssh2.so
file.
/usr/local/lib/php/extensions/no-debug-non-zts-20220829
foldermv /tmp/pear/download/ssh2-1.4/modules/ssh2.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829
php -m
to check the extensions.