Hallo Christoph
Thanks a lot for your reply. I do have PHP 8.3 and other PHP versions installed
on the system as well.
"php -v" outputs:
----
PHP 8.1.29 (cli) (built: Jun 6 2024 16:52:57) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.29, Copyright (c) Zend Technologies
with Zend OPcache v8.1.29, Copyright (c), by Zend Technologies
----
"update-alternatives --config php" outputs:
There are 5 choices for the alternative php (providing /usr/bin/php).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/bin/php8.3 83 auto mode
1 /usr/bin/php7.4 74 manual mode
2 /usr/bin/php8.0 80 manual mode
* 3 /usr/bin/php8.1 81 manual mode
4 /usr/bin/php8.2 82 manual mode
5 /usr/bin/php8.3 83 manual mode
However, php8.1 is set active as indicated by the "*", which is confirmed by
"php -v".
And also "pecl version" outputs:
----
PEAR Version: 1.10.13
PHP Version: 8.1.29
Zend Engine Version: 4.1.29
----
This is why I was assuming the ssh2 module has been built with 8.1.29.
However, the build process stores the binaries in the 20230831 directory.
----
downloading ssh2-1.4.1.tgz ...
Starting to download ssh2-1.4.1.tgz (34,265 bytes)
.........done: 34,265 bytes
6 source files, building
running: phpize
Configuring for:
PHP Api Version: 20230831
Zend Module Api No: 20230831
Zend Extension Api No: 420230831
----
Do I correctly assume it's phpize changing to 8.3 while preparing the build
env? Do you know why phpize is doing so? Is there a related configuration
file or option I could adapt to make phpize/peck use 8.1.29?
Vielen Dank für deine Unterstützung!
Mark
-----Ursprüngliche Nachricht-----
Von: Christoph M. Becker [mailto:[email protected]]
Gesendet: Donnerstag, 26. September 2024 12:37
An: [email protected]; [email protected]
Betreff: Re: [PECL-DEV] ssh2.so
Hi!
On 26.09.2024 at 03:09, [email protected] wrote:
> I can't get any of the ssh2.so releases >= 1.3 (prior versions do not
> support PHP 8.x) working with PHP 8.1.29. Installing/compiling with pecl
> works, but ssh2 >= 1.3 seems to implement PHP API version 20230831 which
> leads to a version mismatch and PHP throwing an error/not initializing the
> module, as 8.1.29 is using PHP API version 20210902.
>
> Did I get something wrong or did I miss anything? Is there a way to get
> 8.1.29 to work with one of the ssh2 versions?
The API versions are not supposed to be defined by the extension, but
rather are taken from the PHP version which is used to build the
extension. So unless something terribly wrong is going on with ssh2, it
is quite likely that you've inadvertently have build the ssh2.so with
PHP 8.3, and such ssh2.so can't be loaded into PHP 8.1.
I'd start with checking the output of `pecl version`.
Christoph