Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 454663c

Browse files
authoredNov 22, 2024
Add a hint how to detect Vips is correctly installed
1 parent a8cc66c commit 454663c

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
 

‎README.md

+29
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,35 @@ zend.max_allowed_stack_size=-1
6565

6666
To your `php.ini`.
6767

68+
#### Troubleshooting
69+
70+
To make sure to have all correctly installed and your php correctly configure use the following script in your terminal:
71+
72+
```bash
73+
php -r 'echo "Has FFI Extension: " . (extension_loaded("ffi") ? "true" : "false") . PHP_EOL;
74+
echo "Has FFI Class: " . (class_exists(FFI::class) ? "true" : "false") . PHP_EOL;
75+
echo "Has FFI Enabled: " . (ini_get("ffi.enable") === "1" ? "true" : "false") . PHP_EOL;
76+
echo "Has zend.max_allowed_stack_size correct: " . (ini_get("zend.max_allowed_stack_size") === "-1" ? "true" : "false") . PHP_EOL;
77+
try {
78+
require_once("vendor/autoload.php");
79+
$libVipsInstalled = \\Jcupitt\\Vips\\Config::version();
80+
echo "Has LibVips Installed: " . $libVipsInstalled . PHP_EOL;
81+
} catch (\Exception $e) {
82+
echo "Has LibVips Installed: false " . PHP_EOL;
83+
echo PHP_EOL . "Error: " . $libVipsError = $e->getMessage();
84+
}'
85+
```
86+
87+
It should output:
88+
89+
```bash
90+
Has FFI Extension: true
91+
Has FFI Class: true
92+
Has FFI Enabled: false
93+
Has zend.max_allowed_stack_size correct: true
94+
Has LibVips Installed: 8.16.0
95+
```
96+
6897
### Example
6998

7099
```php

0 commit comments

Comments
 (0)
Please sign in to comment.