I am trying to install this on a Windows+Apache
machine.
Documentation says that SSH2 requires the OpenSSL
and libssh2
libraries.
I have added this lines in my php.ini
file:
extension=php_openssl.dll
extension=php_ssh2.dll
and restarted Apache but it still not working (Fatal error: Call to undefined function ssh2_connect()
).
Can anyone explain me how to install this service?
Here's how I did it:
Downloaded Win32 SSH2 PECL extension from this location (choose the appropriate version);
Extracted the archive's content and:
php_ssh2.dll
and php_ssh2.pdb
files in the ext
folder (e.g. C:\php\ext
);libssh2.dll
file to C:\Windows\system32
and (if you got Win64) C:\Windows\SysWOW64
folder(s);Run the following command to register the DLL:
C:\> regsvr32 libssh2.dll
Restarted Apache.
Final note
If you got PHP x64, you have to lookup for the x64 version of the SSH2 library / DLLs. This site offers some Win64 compiled libraries for PHP, try here first.
Hope this helps.
If anyone is having trouble installing SSH2, here's how I did it:
1) Download SSH2 PECL library from PHP.net [choose the appropriate version].
2) Copy libssh2.dll
to System32 [x86] or SysWOW64 [x64] folder.
3) Copy php_ssh2.dll
and php_ssh2.pdb
to php/ext folder.
4) Remove ';' from the ;extension=php_ssh2.dll
line in php.ini. If this line is not on your php.ini, add it.
5) Restart Apache.
php_ssh2.dll
in ext folderlibssh2.dll
in php folderIIS
that work for me
PHP 5.4.25 NTS + Windows Server 2012
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With