diff --git a/CHANGELOG.md b/CHANGELOG.md index bb0e913..e31e17e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to `php-vips` will be documented in this file. +## master + +- better ffi startup diagnostics [ping-localhost] + ## 2.6.1 - 2025-12-10 - suppress autodoc of `composite` and `DemandStyle` [jcupitt] diff --git a/src/FFI.php b/src/FFI.php index 722065d..70b948c 100644 --- a/src/FFI.php +++ b/src/FFI.php @@ -278,11 +278,13 @@ private static function init(): void } // detect the most common installation problems - if (!extension_loaded('ffi')) { - throw new Exception('FFI extension not loaded'); + if (!extension_loaded("ffi")) { + throw new Exception("FFI extension not loaded"); } - if (!ini_get('ffi.enable')) { - throw new Exception("ffi.enable not set to 'true'"); + $enable = ini_get("ffi.enable"); + if ($enable != "true" && + $enable != "1") { + throw new Exception("ffi.enable set to '$enable', not 'true'"); } $vips_libname = self::libraryName("libvips", 42);