From 454663c1ddb9bd60272c8348f3c90e18d5ade84b Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Fri, 22 Nov 2024 09:55:43 +0100 Subject: [PATCH 1/2] Add a hint how to detect Vips is correctly installed --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index 39ed779..ecbf31c 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,35 @@ zend.max_allowed_stack_size=-1 To your `php.ini`. +#### Troubleshooting + +To make sure to have all correctly installed and your php correctly configure use the following script in your terminal: + +```bash +php -r 'echo "Has FFI Extension: " . (extension_loaded("ffi") ? "true" : "false") . PHP_EOL; + echo "Has FFI Class: " . (class_exists(FFI::class) ? "true" : "false") . PHP_EOL; + echo "Has FFI Enabled: " . (ini_get("ffi.enable") === "1" ? "true" : "false") . PHP_EOL; + echo "Has zend.max_allowed_stack_size correct: " . (ini_get("zend.max_allowed_stack_size") === "-1" ? "true" : "false") . PHP_EOL; + try { + require_once("vendor/autoload.php"); + $libVipsInstalled = \\Jcupitt\\Vips\\Config::version(); + echo "Has LibVips Installed: " . $libVipsInstalled . PHP_EOL; + } catch (\Exception $e) { + echo "Has LibVips Installed: false " . PHP_EOL; + echo PHP_EOL . "Error: " . $libVipsError = $e->getMessage(); + }' +``` + +It should output: + +```bash +Has FFI Extension: true +Has FFI Class: true +Has FFI Enabled: false +Has zend.max_allowed_stack_size correct: true +Has LibVips Installed: 8.16.0 +``` + ### Example ```php From 5630048e21de20f1670fde961a2de88cd8f6b28f Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Fri, 22 Nov 2024 09:56:29 +0100 Subject: [PATCH 2/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ecbf31c..4a9b48b 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ It should output: ```bash Has FFI Extension: true Has FFI Class: true -Has FFI Enabled: false +Has FFI Enabled: true Has zend.max_allowed_stack_size correct: true Has LibVips Installed: 8.16.0 ```