Welcome Guest. Please Login or Register  


You are here: Index > Webuzo > Suggestions > Topic : SSH PHP Extension



Threaded Mode | Print  

 SSH PHP Extension, SSH2 php extension (3 Replies, Read 1808 times)
minidantebtc
Group: Member
Post Group: Newbie
Posts: 3
Status:
Please add the ssh2 module for PHP 7.0, the webuzo panel only have SSH2 for PHP 5.6
IP: --   

SSH PHP Extension
minidantebtc
Group: Member
Post Group: Newbie
Posts: 3
Status:
I would be very grateful :D
IP: --   

SSH PHP Extension
nikhil89
Group: Softaculous Team
Post Group: Elite Member
Posts: 468
Status:
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
IP: --   

SSH PHP Extension
minidantebtc
Group: Member
Post Group: Newbie
Posts: 3
Status:
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
IP: --   

« Previous    Next »

Threaded Mode | Print  



Jump To :


Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is October 24, 2018, 5:04 am.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 11  |  Page Created In:0.154