Php 7.4 install ssh2 windows

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?

BenMorel

32.6k48 gold badges170 silver badges302 bronze badges

asked Feb 28, 2013 at 11:29

Php 7.4 install ssh2 windows

0

Here's how I did it:

  1. Downloaded Win32 SSH2 PECL extension from this location (choose the appropriate version);

  2. Extracted the archive's content and:

    • placed php_ssh2.dll and php_ssh2.pdb files in the ext folder (e.g. C:\php\ext);
    • copied libssh2.dll file to C:\Windows\system32 and (if you got Win64) C:\Windows\SysWOW64 folder(s);
  3. Run the following command to register the DLL:

    C:\> regsvr32 libssh2.dll
    
  4. 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.

Paolo Stefan

9,8235 gold badges47 silver badges64 bronze badges

answered May 10, 2013 at 10:39

Php 7.4 install ssh2 windows

Alex BAlex B

3113 silver badges6 bronze badges

6

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 7.4 install ssh2 windows

answered Oct 18, 2013 at 4:33

3

  1. Place php_ssh2.dll in ext folder
  2. Place libssh2.dll in php folder
  3. Restart IIS

that work for me

  • PHP 5.4.25 NTS + Windows Server 2012

Php 7.4 install ssh2 windows

chriz

1,3332 gold badges16 silver badges32 bronze badges

answered Jul 17, 2014 at 11:29

MrTeChIdMrTeChId

811 silver badge1 bronze badge

1

If you are running xamp 3.2.1 and PHP 5.6.8, this could be helpful for you.

Do what alex b said, and download the package that corresponds dependindg your php version (and bits) from this page (link)

I've downloaded and replaced in C:\xampp\php\ext and it worked!

Hope this helps, regards.

answered Nov 21, 2016 at 9:31

Php 7.4 install ssh2 windows

C.B.C.B.

1744 silver badges14 bronze badges

1

I have wamp with PHP 5.6.25/7.0.10 – MySQL 5.7.14 installed and I cm currently working on PHP 7.0. I had the same error. I checked using phpinfo() if both librarires OpenSSL and libssh2 was working(you can google how to check it). After I could see they was working, I have downloaded php_ssh2.dll at http://pecl.php.net/package/ssh2/1.0/windows (can also be found http://windows.php.net/downloads/pecl/releases/ssh2/ ) for the 7.0 version, put it to php\ext folder. Than I included it in php.ini file using extension=php_ssh2.dll.

Then it appeared at phpinfo(). And it worked. Hope it helps.

answered Jan 30, 2017 at 8:51

Fix that worked for me. Am running xampp v. 3.2.1 apache 2.2 facing the same issue tried placing the dll files at different c: location but failed finally this helped.

1.) Download the version specific dll files from http://pecl.php.net/package/ssh2/0.12/windows and extract the files

Note that even though you are in 64 bit version of windows download the 32 version of THREAD SAFE ssh i.e. Thread Safe (TS) x86 as per your version of php

2.) Add/replace the libssh2.dll at C:\xampp\php (standard installation)

3.) Add/replace the php_ssh2.dll & php_ssh2.pdb within the C:\xampp\php\ext (standard installation)

4.) restart the apache server

Worked Like a charm

CHEERS

answered Aug 7, 2015 at 6:57

1

First of all, your question reveals two misconceptions:

  1. The Requirements section actually says this:

    The » OpenSSL and » libssh2 libraries are required. Ensure that the development libraries are installed, where a typical package name might be openssl-dev.

    It isn't talking about PHP extensions, it's talking about third-party libraries that have nothing to do with PHP.

  2. extension=php_ssh2.dll requires that you actually have a file called php_ssh2.dll in your PHP's ext directory and you probably don't have it, mainly because it isn't bundled with PHP.

If we check the Installation chapter we can read that SSH2 is a PECL extension. There're a few links with instructions but I can make a summary of the important info:

  • You need a php_ssh2.dll file that matches your PHP installation.
  • Neither the PHP team nor the PECL team distribute such file.
  • Installing PECL extensions on Windows is hard. You need to download the C source code, grab a C compiler and make the file yourself, or find someone who already did it for you.

Said that, unless you Google for php_ssh2.dll and find something relevant, you're probably out of luck.

answered Feb 28, 2013 at 13:13

Álvaro GonzálezÁlvaro González

137k38 gold badges253 silver badges340 bronze badges

5

Not the answer you're looking for? Browse other questions tagged php windows apache dll libssh2 or ask your own question.

How do I install SSH2 on Windows 10?

If anyone is having trouble installing SSH2, here's how I did it:.
Download SSH2 PECL library from PHP.net [choose the appropriate version]..
Copy libssh2. dll to System32 [x86] or SysWOW64 [x64] folder..
Copy php_ssh2. dll and php_ssh2. ... .
Remove ';' from the ;extension=php_ssh2. ... .
Restart Apache..

What is PHP SSH2?

The SSH2 extension provides functions for accessing remote machines using the secure SSH and SFTP protocols.