Missing php_ssh2.dll extension for php 7.2 (windows) - php

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?

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

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/

Related

Datastax Cassandra PHP extension in WAMP

I am using WAMP with php v5.5.12.
Trying to install datastax php driver(https://github.com/datastax/php-driver).
1. I take the compiled dll file from here and put it in /ext folder
2. Add the extention=php_cassandra.dll to php.ini
3. Restarting WAMP server
I get this error in wamp php error log:
[28-Jan-2016 07:32:57 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.5.12/ext/php_cassandra.dll' - The specified module could not be found.
Also installed Pear package, but there are no changes.
Does anyone here experience with cassandra new driver on windows?
What can be the problem?
I could not either make the .dll found on the pecl php site work. Same error.
But the .dll found here works!
http://downloads.datastax.com/php-driver/windows/cassandra/
You will need to use the Thread Safe version (TS) and of course the one for PHP5.5. Also you need to use the x86 if you WAMPServer is the 32 bit and the x64 if WAMPServer is the 64bit version
That dll should be place into the \wamp\bin\php\php5.5.12\ext folder

How to find which version of libssh2 is required for my php version (on Windows)

When I check my php version I get the following warnings:
PHP Warning: PHP Startup: ssh2: Unable to initialize module
Module compiled with module API=20121212
PHP compiled with module API=20131226
These options need to match
in Unknown on line 0
I'm trying to understand which versions work together and how I can get hold of the correct version to setup PHP with SSH2. I have been able to find the .tar.gz versions of libssh from places like the following:
https://www.rpmfind.net/linux/RPM/remi/enterprise/6/x86_64/php56-php-pecl-ssh2-0.12-4.el6.remi.x86_64.html
The problem is I am using a Windows machine and not Linux. Does anyone know whether I can get the same libssh version for Windows? Or do I have to downgrade PHP to the same level as ssh2? Or is it nothing to worry about it and just a quirk of Windows?
Here are some details that might be of use:
OS: Windows 10 (x64)
PHP Version: PHP 5.6.15 (cli) (built: Oct 29 2015 12:39:50)
Microsoft Visual C++ 2015 Redistributable (x64) 11.0.61030
Server version: Apache/2.4.17 (Win64)
Apache Lounge VC11 Server built: Oct 13 2015 11:37:51
In addition... I've found the version of the ssh2 zip that I downloaded. It was 5.5 Thread Safe (TS) x64 from: https://pecl.php.net/package/ssh2/0.12/windows
So, I guess that means I need to downgrade my PHP to 5.5 for this to work properly. Is that correct or is there a better way?
I've found a solution to the problem. As stated in the OP the problem was that the PHP module was a later version than the SSH2 module. The question was how to find the versions that would work with the setup stated. This proved to be quite tricky because there were more systems that needed to be integrated than I first thought. I falsely assumed that the latest versions would all play nice together.
As I am running Windows 10 64-bit I wanted to get the stable version of PHP that runs against this - that would be PHP 7. As stated here: http://windows.php.net/download/. Initially I downloaded PHP 7.0 but this didn't play nicely with another module that I wanted to install, which was MongoDB.
When I looked into MongoDB I realised that there wasn't a driver for PHP 7.0 yet so the latest one I could get was PHP 5.6. This meant that I had to settle for an "experimental" 64-bit version of PHP. So I made the shift and everything was playing nice until I decided that I wanted to get Composer so that I could manager my PHP dependencies.
When I tried to intall Composer using the Windows installer it failed with an unknown exception and suggested I try from the command line to get a better error response. So I duly did and the error stated that the ssh2 module was not compatible with PHP 5.6.
That eventually brought me to ask the question on stackoverflow.
After some more digging into what versions of ssh2 there are I was brought to the following page: http://windows.php.net/downloads/pecl/releases/ssh2/0.12/
This told me that the latest version of PHP that was compatible with the SSH2 extension was PHP 5.5. So... it looks like the solution was to downgrade to version 5.5.
When I started looking for the new (old) version to download I came across this wonderful bundle package site: https://www.apachelounge.com/viewtopic.php?t=6123
From there I could download this version (https://phpdev.toolsforresearch.com/php-5.5.20-Win32-VC11-x64.zip) and it would contain all the modules that I needed in the correct version.
So, in conclusion, a little more up-front analysis into what versions play nice together would have helped or understanding that the Apache Lounge has all the versions that work together in a nice tidy bundle.

Will a PECL package for PHP 5.4 work with 5.5?

I'm looking to install the Amazon ElastiCache Memcached Cluster Client so I can take advantage of autodiscovery of cache nodes.
Unfortunately, it looks like they only available options are
Java
PHP 5.3 (64-bit Linux)
PHP 5.3 (32-bit Linux)
PHP 5.4 (64-bit Linux)
PHP 5.4 (32-bit Linux)
The version of PHP that is installed on my EC2 instance is PHP 5.5.3-1ubuntu2.1 (the default for Ubuntu).
Does anyone have any insight into whether or not the 5.4 package will work with PHP 5.5 or not? I did find one person looking for this on their forums but there doesn't seem to be a resolution there yet.
Only one way to find out, right? Well, the answer is no.
I followed the installation instructions and got this when I started up PHP:
PHP Warning: PHP Startup: memcached: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20121212
These options need to match
in Unknown on line 0

Can't install gmagick on Windows 7 XAMPP

I have XAMPP 1.8.1 with PHP 5.4.7 installed. When I add php_gmagick_ts.dll to my php.ini (I made sure that I need the ts and not the nts version), upon restarting Apache I'm getting these errors:
The procedure entry point php_checkuid_ex could not be located in the
dynamic link library php5ts.dll
and after that one:
PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_gmagick_ts.dll' - The specified procedure could not be found.
Any help?
AFAIK there is currently no GraphicsMagick DLL available working with PHP 5.4 on Windows.
As the availability of php_gmagick_(n)ts.dll for latest PHP versions is always a problem, I recommend that you either drop back to PHP 5.3 (DLLs available here) or that you use the standalone version of GraphicsMagick and call it from within PHP using exec() commands.

Connecting to DB2 through PHP

I'm trying to connect to a DB2 databse from a windows machine using XAMPP.
When I try to load the php_ibm_db2 module I get the following error
"PHP Startup: ibm_db2: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20090626
These options need to match"
How do I fix this and connect to a db2 database?
This means you are trying to use an old (it seems : it's from 2006) version of the imb_db2 .dll file, with a recent (it's from 2009) version of PHP. You should use the same version for both PHP and the extension.
There is a recent version of some extensions .dll available from http://downloads.php.net/pierre/ ; amongst those, there is a couple of versions of php_ibm_db2.dll 1.8 ; with a bit of luck, maybe they'll match your version of PHP -- and there are versions for both PHP 5.2 and 5.3.
You have different "versions":
20060613
and
20090626
Did you compile these by yourself? Re-compile it.
The top answer got close but didn't have the right php_ibm_db2.dll I needed for PHP 5.3.2 VC9 (windows) NTS (non-thread-safe). But I found one that has it - and many more! Link:
PHP IBM DB2 DLLs on SourceForge via Technology Explorer for DB2

Categories