libvips / php-vips

php binding for libvips
MIT License
615 stars 25 forks source link

Installing with pecl with PHP 8.1 and homebrew: "you need at least libvips 8.2 for this module" #126

Closed Synchro closed 2 years ago

Synchro commented 2 years ago

This seems to be the same problem as in #85, but the solutions suggested there don't work.

$ PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig pecl install vips
downloading vips-1.0.12.tgz ...
Starting to download vips-1.0.12.tgz (561,450 bytes)
.................................................................................................................done: 561,450 bytes
4 source files, building
running: phpize
Configuring for:
PHP Api Version:         20210902
Zend Module Api No:      20210902
Zend Extension Api No:   420210902
...
enable vips [yes] : /usr/local/opt/vips
...
running: /private/tmp/pear/temp/vips/configure --with-php-config=/usr/local/opt/php/bin/php-config --with-vips=/usr/local/opt/vips
...
checking for vips support... yes, shared
configure: error: you need at least libvips 8.2 for this module
ERROR: `/private/tmp/pear/temp/vips/configure --with-php-config=/usr/local/opt/php/bin/php-config --with-vips=/usr/local/opt/vips' failed

During this I'm asked enable vips [yes], and all of yes, /usr/local/opt/vips, and /usr/local/opt/libvips produce the same result. FWIW:

$ /usr/local/opt/vips/bin/vips -v
vips-8.12.1-Wed Nov 24 15:41:04 UTC 2021
$ /usr/local/opt/libvips/bin/vips -v
vips-8.12.1-Wed Nov 24 15:41:04 UTC 2021

Similarly, trying the build with or without the brew path to pkgconfig makes no difference either.

Anything I've missed?

FluffyDiscord commented 2 years ago

Same issue, but in docker linux

FluffyDiscord commented 2 years ago

What helped me was installing additional package using

sudo apt-get install libvips-dev -y
jcupitt commented 2 years ago

Sorry, this issue dropped off my radar :(

Yes, the old PECL module compiles C source code against libvips, so you'll need the libvips dev package, and the php dev package too.

The new php-vips 2.x doesn't need the PECL extension -- it uses FFI to make direct calls into the libvips shared library. It only needs the binaries to install.

You can still use the php-vips 1.x branch if you like, but I would consider moving to the new version. The API is the same, so there are no downstream code changes.

FluffyDiscord commented 2 years ago

The FFI is non standard module (practically noone includes it in their php builds and I have to compile it on my own). I would rather have pecl extension or something "plug & play".

jcupitt commented 2 years ago

It's a standard part of PHP 7.4 and later, I think.

You're right, I don't know how many php builds include it, but at least Debian-like and RedHat-like systems do have it compiled into the php binary.