Grzesiek
Grzesiek

Reputation: 452

Missing php_ssh2.dll extension for php 7.2 (windows)

Today I wanted to update my dev machine with new php so i downloaded and set up PHP 7.2.7 x64.

After that I sterted collecting missing modules and everything goes fine till i came to the last one: php_ssh2.dll. Downloaded latest version 1.1.2 from https://pecl.php.net/package/ssh2

Unfortunately it doesn't work. Error:

Warning: PHP Startup: ssh2: Unable to initialize module
Module compiled with module API=20160303
PHP    compiled with module API=20170718
These options need to match

Anyone have any tips for me how to make it work?

Upvotes: 1

Views: 7789

Answers (2)

MonkeyZeus
MonkeyZeus

Reputation: 20737

On Windows, PHP 7.2.x is built using VC15 and the latest SSH2 module is v1.1.2 which was built on VC14.

So you need to either downgrade to PHP 7.1.x or wait for the PHP team to compile SSH2 in VC15.

Additionally, I have no experience with this but you could decide to compile it yourself in VC15 if you are comfortable with that sort of thing.


Update:

SSH 1.1.2 now has a VC15 build at https://windows.php.net/downloads/pecl/releases/ssh2/1.1.2/

The latest SSH is 1.2 which currently has PHP 7.1-7.4 builds: https://windows.php.net/downloads/pecl/releases/ssh2/1.2/

Upvotes: 4

Jirka Hrazdil
Jirka Hrazdil

Reputation: 4021

I have compiled SSH2 module for PHP 7.2 (and PHP 7.3) on Windows. It is available at https://github.com/nufue/pecl-ssh2-windows

Upvotes: 5

Related Questions