need SSH2 install help.
Posted by: everseeker (---.swo.res.rr.com)
Date: March 04, 2015 10:19PM

1 - Windows version used (Specify version number AND whether 32 or 64 bit)
Win 8.1 x64
2 - Version WampServer (Specify version number AND whether 32 or 64 bit)
Version 2.5 (x64?... runs)
3 - Apache Version
As set by WAMP Install
4 - PHP Version
As set by WAMP Install
5 - MySQL Version
As set by WAMP Install
6 - What color is the WampServer icon (in the notification area of the taskbar
Green

Now that this is done. Here's my issue.
I tried to install SSH2 by following this:
[stackoverflow.com]
Used this file: php_ssh2-0.12-5.5-ts-vc11-x64.zip

Extracted the archive's content and: - placed php_ssh2.dll and php_ssh2.pdb files in the "ext" (e.g c:\php\ext) folder; - copied libssh2.dll file to c:\windows\system32 and (if you got Win64) C:\Windows\SysWOW64 folder(s); Done. No problems

Executed from the OS prompt the following command to register the DLL: c:>regsvr32 libssh2.dll
Failed. got an error message (entry-point DllRegisterServer was not found)... hurumph

added extention:php_ssh2.dll to the php.ini

restart apache (Well, rebooted entire PC)

Ran:
<?php
$ssh = ssh2_connect('www.6connect.com');
echo ssh2_fingerprint($ssh);
print_r($ssh);
?>
100% Fail... Fatal error: Call to undefined function ssh2_connect()

any thoughts?



Edited 1 time(s). Last edit at 03/05/2015 07:23PM by everseeker.

Options: ReplyQuote
Re: need SSH2 install help.
Posted by: everseeker (---.swo.res.rr.com)
Date: March 05, 2015 07:18PM

Tried the phpseclib route... no joy there either.

in addition, Toured the wampmanager menu

wampmanager -> PHP -> Extension ->php_ssh2 entry is present... bit it has an ! in a triangle....That does NOT bode well...



Edited 1 time(s). Last edit at 03/05/2015 07:26PM by everseeker.

Options: ReplyQuote
Re: need SSH2 install help.
Posted by: RiggsFolly (---.as43234.net)
Date: March 05, 2015 08:14PM

How To Install the SSH2 PHP Extension to WAMPServer.

DOWNLOAD the SSH2 extension from here
- click on the word 'DLL' next to the windows icon to get to the windows builds.

For WAMPServer you will need the TS ( Thread Safe ) versions
Download the Thread Safe version that matches your WAMPServer i.e. 32bit/64bit and the major version of PHP you want to install it into i.e. PHP5.4 or PHP5.5 etc.

If you are running 32bit WAMPServer even on a 64bit Windows you should be using the 32bit (x86) version of ssh2!

Using wampmanager, stop all services

- wampmanager -> Stop all Services


Extract these 2 files from the zip (rememeber the SSH2 files are specific to a version of PHP, so make sure you use the correct zip file).

copy libssh2.dll to \wamp\bin\php\phpx.y.z\
copy php_ssh2.dll to \wamp\bin\php\phpx.y.z\ext

Edit php.ini ( using the wampmanager menus )

- wampmanager -> PHP -> php.ini

Locate the section containing the extension parameters and add this line
extension=php_ssh2.dll

IF you are using WAMPServer 2.5.15 or later you can skip this next step as it has already been incorporated into the WAMPServer refresh process.

IF you are using WAMPServer 2.5 or older versions :

Edit \wamp\scripts\config.inc.php
Find this section of the file,
$phpDllToCopy = array (

And add this line into the array, it can go anywhere in that list

$phpDllToCopy = array (
	'libssh2.dll',


Start all the services again

- wampmanager -> Start all Services

Look at
- wampmanager -> PHP -> PHP Extensions
-- You should see php_ssh2 in the list with a tick beside it.


Now you need to get WAMPManager to rebuild the SYMLINKS into the \apachex.y.z\bin folder. So using the wampamanager menus DO:

- wampmanager -> Apache -> Version -> 2.4.9 ( click on the version number, it may or may not be 2.4.9 )

This should take a few second and then you are ready to test that ssh2 is loaded.

Now launch localhost

- wampmanager -> localhost



On the homepage you should see `ssh2` in the list of `Loaded Services`



Click the `phpinfo()` link on the WAMPServer homepage and you should see the following information proving that SSH2 has been loaded





Now if you want to use SSH2 from PHP used at the command line ( PHP CLI ) then you need to do one more thing.

Edit \wamp\bin\php\php{version}\php.ini

Locate the section containing the extension parameters and add this line
extension=php_ssh2.dll


You are done.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 4 time(s). Last edit at 01/21/2016 11:59AM by RiggsFolly.

Options: ReplyQuote
Re: need SSH2 install help.
Posted by: RiggsFolly (---.as43234.net)
Date: March 06, 2015 10:54AM

Actually I just did a check and I dont think you need to copy the libssh2.dll to \wamp\bin\apache\apachex.y.z\bin

This also makes it more compatible with version switching of PHP and Apache if you dont have that dll in the Apache/bin folder,

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: need SSH2 install help.
Posted by: everseeker (---.swo.res.rr.com)
Date: March 06, 2015 10:33PM

change made. No help. Still getting 2 warnings on PHP load. and ssh2 calls still inop

Options: ReplyQuote
Re: need SSH2 install help.
Posted by: RiggsFolly (---.as43234.net)
Date: March 07, 2015 11:12AM

Ok, something from the links in the PM yoe sent me made me think.

Are you writing PHP code that you run from the CLI ( Command Line Interface ) ?

If so, remember that there are 2 php.ini files in WAMPServer and most AMP installations.

\wamp\bin\php\php{version}\php.ini is used by the CLI

\wamp\bin\php\php{version}\phpForApache.ini is used by the Apache ( and is the one edited when you use the wampmanager menus )

So if you are running php from the command line, you also need to edit that \wamp\bin\php\php{version}\php.ini to add the extension like you did presumably for the phpForApache.ini

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: need SSH2 install help.
Posted by: everseeker (---.swo.res.rr.com)
Date: March 09, 2015 06:57PM

Going to reply in a new thread, with the "solution set"

Options: ReplyQuote


Sorry, only registered users may post in this forum.