Softaculous


Topic : SSH PHP Extension


Posted By: minidantebtc on February 2, 2018, 3:41 am
Please add the ssh2 module for PHP 7.0, the webuzo panel only have SSH2 for PHP 5.6

Posted By: minidantebtc on February 2, 2018, 3:42 am | Post: 1
I would be very grateful :D

Posted By: nikhil89 on February 2, 2018, 10:30 am | Post: 2
Please follow the below steps to add ssh2 extension in PHP.
(Note: You will have to execute the belows commands as root user)

1. Enter directory with PHP version for which you would like to create ssh2 extension
For PHP 5.6 -> /usr/local/apps/php56/bin/
For PHP 7.0 -> /usr/local/apps/php70/bin/
For PHP 7.1 -> /usr/local/apps/php71/bin/

Command:
Code
cd /usr/local/apps/php56/bin/


2. Download the extension package
For PHP 5.6 use the below command:


For PHP 7.0 & above:


3. Untar / Unzip extension package and enter is directory
For PHP 5.6:-
Code
tar -xvf ssh2-0.13.tgz

cd ssh2-0.13.tgz


For PHP 7.0 & above:-

Code
unzip php7.zip

cd pecl-networking-ssh2-php7


4. Run phpize
For PHP 5.6 -> /usr/local/apps/php56/bin/phpize
For PHP 7.0 -> /usr/local/apps/php70/bin/phpize
For PHP 7.1 -> /usr/local/apps/php71/bin/phpize
(if any error occurs run yum or apt-get install autoconf)

5. Configure with providing paths to php-config and libssh library path
For PHP 5.6:
Code
./configure --with-php-config=/usr/local/apps/php56/bin/php-config --with-ssh2=/usr/local/apps/

For PHP 7.0:
Code
./configure --with-php-config=/usr/local/apps/php70/bin/php-config --with-ssh2=/usr/local/apps/

For PHP 7.1:
Code
./configure --with-php-config=/usr/local/apps/php71/bin/php-config --with-ssh2=/usr/local/apps/


6. Run it's compilation and installation
Code
make && make install


7. Now move the compiled extension to the extension directory
For PHP 5.6:
Code
mv /usr/local/apps/php56/lib/extensions/no-debug-non-zts-20131226/ssh2.so /usr/local/apps/php56/ext/

For PHP 7.0:
Code
mv /usr/local/apps/php70/lib/extensions/no-debug-non-zts-20151012/ssh2.so /usr/local/apps/php70/ext/

For PHP 7.1:
Code
mv /usr/local/apps/php71/lib/extensions/no-debug-non-zts-20160303/ssh2.so /usr/local/apps/php71/ext/


8. Now add the extension in the extra.ini file for loading the extension in the PHP
For PHP 5.6:
Code
echo "extension=ssh2.so" >> /usr/local/apps/php56/etc/php.d/extra.ini

For PHP 7.0:
Code
echo "extension=ssh2.so" >> /usr/local/apps/php70/etc/php.d/extra.ini

For PHP 7.1:
Code
echo "extension=ssh2.so" >> /usr/local/apps/php71/etc/php.d/extra.ini


9. Now restart the Web Server and PHP service from the Webuzo Panel. Please refer to the below guide to restart the service:
Restart Service Guide


Edited by nikhil89 : February 2, 2018, 10:31 am

Posted By: minidantebtc on February 2, 2018, 1:08 pm | Post: 3
Thanks very much :DDD, It worked perfectly.
Quote From : nikhil89 February 2, 2018, 10:30 am
Please follow the below steps to add ssh2 extension in PHP.(Note: You will have to execute the belows commands as root user)

1. Enter directory with PHP version for which you would like to create ssh2 extension
For PHP 5.6 -> /usr/local/apps/php56/bin/
For PHP 7.0 -> /usr/local/apps/php70/bin/
For PHP 7.1 -> /usr/local/apps/php71/bin/

Command:
Code
cd /usr/local/apps/php56/bin/


2. Download the extension package
For PHP 5.6 use the below command:


For PHP 7.0 & above:


3. Untar / Unzip extension package and enter is directory
For PHP 5.6:-
Code
tar -xvf ssh2-0.13.tgz

cd ssh2-0.13.tgz


For PHP 7.0 & above:-

Code
unzip php7.zip

cd pecl-networking-ssh2-php7


4. Run phpize
For PHP 5.6 -> /usr/local/apps/php56/bin/phpize
For PHP 7.0 -> /usr/local/apps/php70/bin/phpize
For PHP 7.1 -> /usr/local/apps/php71/bin/phpize
(if any error occurs run yum or apt-get install autoconf)

5. Configure with providing paths to php-config and libssh library path
For PHP 5.6:
Code
./configure --with-php-config=/usr/local/apps/php56/bin/php-config --with-ssh2=/usr/local/apps/

For PHP 7.0:
Code
./configure --with-php-config=/usr/local/apps/php70/bin/php-config --with-ssh2=/usr/local/apps/

For PHP 7.1:
Code
./configure --with-php-config=/usr/local/apps/php71/bin/php-config --with-ssh2=/usr/local/apps/


6. Run it's compilation and installation
Code
make && make install


7. Now move the compiled extension to the extension directory
For PHP 5.6:
Code
mv /usr/local/apps/php56/lib/extensions/no-debug-non-zts-20131226/ssh2.so /usr/local/apps/php56/ext/

For PHP 7.0:
Code
mv /usr/local/apps/php70/lib/extensions/no-debug-non-zts-20151012/ssh2.so /usr/local/apps/php70/ext/

For PHP 7.1:
Code
mv /usr/local/apps/php71/lib/extensions/no-debug-non-zts-20160303/ssh2.so /usr/local/apps/php71/ext/


8. Now add the extension in the extra.ini file for loading the extension in the PHP
For PHP 5.6:
Code
echo "extension=ssh2.so" >> /usr/local/apps/php56/etc/php.d/extra.ini

For PHP 7.0:
Code
echo "extension=ssh2.so" >> /usr/local/apps/php70/etc/php.d/extra.ini

For PHP 7.1:
Code
echo "extension=ssh2.so" >> /usr/local/apps/php71/etc/php.d/extra.ini


9. Now restart the Web Server and PHP service from the Webuzo Panel. Please refer to the below guide to restart the service:
Restart Service Guide

Posted By: kiwijohn on June 4, 2019, 11:24 pm | Post: 4
Quote From : nikhil89 February 2, 2018, 10:30 am
Please follow the below steps to add ssh2 extension in PHP.
==snip==


Are you able to provide instructions for Windows version?

Posted By: Dhanya on June 5, 2019, 5:06 am | Post: 5
Hi,
Please search on web for enabling SSH2 in PHP for Windows server because Webuzo is a single user control panel which can be installed on Linux Operating System(x86_64)
Let us know if you have any further queries.

Posted By: ionutp23 on January 7, 2020, 12:12 am | Post: 6
Please help i did the same and not working  running this command ./configure --with-php-config=/usr/local/apps/php70/bin/php-config --with-ssh2=/usr/local/apps/

get error

-bash: ./configure: No such file or directory

Powered By AEF 1.0.8 © 2007-2008 Electron Inc.